Module token
jwt token utilities
Functions
blockexchange.parse_token (the) | parses a jwt token |
blockexchange.get_claims (playername) | returns the claims for the playername as table |
blockexchange.get_token (playername) | returns the token for the player in base64 format or nil if not present |
blockexchange.set_token (playername, token) | sets the token for the player or clears it if nil |
Functions
- blockexchange.parse_token (the)
-
parses a jwt token
Parameters:
- the token in string format
Returns:
-
the payload in json format
- blockexchange.get_claims (playername)
-
returns the claims for the playername as table
Parameters:
- playername the name of the player
Returns:
-
the claims for the player or nil
- blockexchange.get_token (playername)
-
returns the token for the player in base64 format or nil if not present
Parameters:
- playername the name of the player
Returns:
-
the token in string/base64 format
- blockexchange.set_token (playername, token)
-
sets the token for the player or clears it if nil
Parameters:
- playername the name of the player
- token the token to set (in base64/string format)