Exemplo n.º 1
0
    def wrapper(*args, **kwargs):
        token = AccessTokenModelV2.objects(
            identity=UUID(get_jwt_identity())).first()

        if token:
            g.user = token.key.owner
        else:
            abort(403)

        return fn(*args, **kwargs)
Exemplo n.º 2
0
 def get(self):
     """
     로그인 여부 체크
     """
     try:
         return Response(
             '', 200 if AccessTokenModelV2.objects(
                 identity=UUID(get_jwt_identity())) else 204)
     except ValueError:
         abort(422)
Exemplo n.º 3
0
        def wrapper(*args, **kwargs):
            try:
                token= AccessTokenModelV2.objects(identity=UUID(get_jwt_identity())).first()

                if token and isinstance(token.key.owner, model):
                    g.user = token.key.owner
                else:
                    abort(403)

                return fn(*args, **kwargs)
            except ValueError:
                abort(422)