class UserToken
- UserToken
- Reference
- Object
Overview
Generates and decodes JSON Web Tokens for Authenticating users.
Included Modules
- Habitat::SettingsHelpers
- Habitat::TempConfig
Defined in:
models/user_token.crConstant Summary
-
ALGORITHM =
JWT::Algorithm::HS256
-
HABITAT_SETTINGS =
[{decl: stubbed_token : String | ::Nil, example: nil, validation: nil}] of Nil
Class Method Summary
- .configure(&)
- .create_token(payload)
- .decode_user_id(token : String) : String | Nil
- .generate(user : User) : String
- .settings
-
.stub_token(token : String, &)
Used in tests to return a fake token to test against.