flask_graphql_auth.util module¶
-
flask_graphql_auth.util.
create_access_token
(identity, user_claims=None)[source]¶ Create a new access token.
Parameters: - identity – The identity of this token, which can be any data that is json serializable. It can also be a python object
- user_claims – User made claims that will be added to this token. it should be dictionary.
Returns: An encoded access token
-
flask_graphql_auth.util.
create_refresh_token
(identity, user_claims=None)[source]¶ Creates a new refresh token.
Parameters: - identity – The identity of this token, which can be any data that is json serializable. It can also be a python object
- user_claims – User made claims that will be added to this token. it should be dictionary.
Returns: An encoded refresh token
-
flask_graphql_auth.util.
get_jwt_claims
()[source]¶ In a protected resolver or mutation, this will return the dictionary of custom claims in the JWT that is accessing the endpoint. If no custom user claims are present, an empty dict is returned instead.