class

UserToken

Inherits Habitat::SettingsHelpers / Habitat::TempConfig / Reference / Object

Generates and decodes JSON Web Tokens for Authenticating users.

Constants

ALGORITHM = JWT::Algorithm::HS256
HABITAT_SETTINGS = [{decl: stubbed_token : String | ::Nil, example: nil, validation: nil}] of Nil

Class methods

configure
Source
create_token(payload)
Source
decode_user_id(token : String) : Int64 | Nil
Source
generate(user : User) : String
Source
settings
Source
stub_token

Used in tests to return a fake token to test against.

Source

Instance methods

settings
Source

Nested types