Example #1
0
    def invalidate_refresh_token(self, request):
        """Remove a used token from the storage."""

        refresh_token = request._params.get("refresh_token")

        # The request may have no token in parameters which means that the
        # authorization code was used.
        if not refresh_token:
            return

        r_token = refresh_token_api.refresh_token_get_by_token(refresh_token)
        token_api.access_token_delete(
            refresh_token_api.get_access_token_id(r_token.id)
        )  # Cascades
Example #2
0
def delete_all_user_tokens(user_id):
    access_tokens = access_tokens_api.access_token_get_all(user_id=user_id)

    for token in access_tokens:
        access_tokens_api.access_token_delete(token.id)
Example #3
0
def user_token_delete(access_token_id):
    access_tokens_api.access_token_delete(access_token_id)
Example #4
0
def delete_all_user_tokens(user_id):
    access_tokens = access_tokens_api.access_token_get_all(user_id=user_id)

    for token in access_tokens:
        access_tokens_api.access_token_delete(token.id)
Example #5
0
def user_token_delete(access_token_id):
    access_tokens_api.access_token_delete(access_token_id)