Jwt
Recurso de geração de JSON Web Tokens.
accessExpires
_jwt.accessExpires() : int
Description
Sets the time of expiration of the token to the settings in configs.
Return
( int )
accessToken
_jwt.accessToken(userId: int, Values: Values) : Values
Description
This method access to the token of a user and returns the content.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
userId | int | Id of user. |
Values | Values | Values of the user. |
Return
( Values )
Returns the content of the user inserted.
_jwt.accessToken(userId: Values) : Values
Description
This method access to the token of a user and returns the content.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
userId | Values | Id of user. |
Return
( Values )
Returns the content of the user inserted.
check
_jwt.check() : boolean
Description
Verify if a token exists.
Return
( boolean )
Returns the validation.
_jwt.check(token: string) : boolean
Description
This method verify the token.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
token | string | Token to be verify. |
Return
( boolean )
Returns the validation.
_jwt.check(token: Values) : boolean
Description
This method verify the token.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
token | Values | Token to be verify. |
Return
( boolean )
Returns the validation.
data
_jwt.data() : Values
Return
( Values )
_jwt.data(token: string) : Values
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
token | string |
Return
( Values )
dbRecord
_jwt.dbRecord(token: string) : Values
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
token | string |
Return
( Values )
decode
_jwt.decode(token: string) : Values
Description
Encodes the values of the header and body inserted.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
token | string | Acess code. |
Return
( Values )
Returns the values decoded.
encode
_jwt.encode(body: Values) : string
Description
Encodes the body value inserted.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
body | Values | Body value. |
Return
( string )
Returns the value enconded.
_jwt.encode(header: Values, body: Values) : string
Description
Encodes the values of the header and body inserted.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
header | Values | Header value. |
body | Values | Body value. |
Return
( string )
Returns the values encoded.
init
_jwt.init() : JWT
Return
( JWT )
_jwt.init(secret: string, algorithm: string) : JWT
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
secret | string | |
algorithm | string |
Return
( JWT )
isEnabled
_jwt.isEnabled() : boolean
Description
Verify if a token is enable.
Return
( boolean )
Returns enabled.
refreshExpires
_jwt.refreshExpires() : int
Description
Updates the time of expiration of the token to the settings in configs.
Return
( int )
refreshToken
_jwt.refreshToken(refreshToken: string) : Values
Description
Replaces an old token for the new on inserted.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
refreshToken | string | Replace token. |
Return
( Values )
Returns the updated token.
token
_jwt.token() : string
Description
Verify if exists an authenticated token.
Return
( string )
Returns the token.
_jwt.token(Values: Values) : string
Description
Generates a token through jwtBuilder.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
Values | Values | Values for the jwtBuilder. |
Return
( string )
Returns the generation.