module Auth
Extended Modules
Defined in:
auth.crConstant Summary
-
ACCESS_TOKEN_VALIDITY =
5 * 60
-
Logger =
Log.for("Auth")
-
REFRESH_TOKEN_VALIDITY =
60 * 60
Instance Method Summary
- #generate_access_token(user : User)
- #generate_refresh_token(user : User)
-
#generate_token(user : User, validity : Int32)
Generate a token for user for
validity
seconds. - #login(username, password) : Credentials | Nil
- #secret
-
#validate_token(token : String)
Validate a user token.
Instance Method Detail
Generate a token for user for validity
seconds.
Returns generated token as a String
def validate_token(token : String)
#
Validate a user token.
Return user_id associated with that token or nil if the token is invalid