Пример #1
0
 def __init__(self, **kwargs):
     self.id = kwargs.get('id')
     self.token_type = kwargs.get('token_type')
     self.access_token = kwargs.get('access_token')
     self.refresh_token = kwargs.get('refresh_token')
     self.client_id = kwargs.get('client_id')
     self.expires = kwargs.get('expires')
     self.user = User.get_by_id(kwargs.get('user_id')) if kwargs.get('user') is None else kwargs.get('user')
     self.scope = self.get_scope_string(**kwargs)
Пример #2
0
 def __init__(self, **kwargs):
     self.id = kwargs.get('id')
     self.token_type = kwargs.get('token_type')
     self.access_token = kwargs.get('access_token')
     self.refresh_token = kwargs.get('refresh_token')
     self.client_id = kwargs.get('client_id')
     self.expires = kwargs.get('expires')
     self.user = User.get_by_id(kwargs.get(
         'user_id')) if kwargs.get('user') is None else kwargs.get('user')
     self.scope = self.get_scope_string(**kwargs)
Пример #3
0
def jwt_identity(payload):
    return User.get_by_id(payload['identity'])
Пример #4
0
def get_current_user():
    if 'user_id' not in session:
        return None

    return User.get_by_id(session['user_id'])
Пример #5
0
def jwt_identity(payload):
    return User.get_by_id(payload['identity'])
Пример #6
0
def get_current_user():
    if 'user_id' not in session:
        return None

    return User.get_by_id(session['user_id'])