Table of Contents
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @staticmethod | |
| def get_logged_in_user(new_request): | |
| # get the auth token | |
| auth_token = new_request.headers.get('Authorization') | |
| if auth_token: | |
| resp = User.decode_auth_token(auth_token) | |
| if not isinstance(resp, str): | |
| user = User.query.filter_by(id=resp).first() | |
| response_object = { | |
| 'status': 'success', | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from functools import wraps | |
| from flask import request | |
| from app.main.service.auth_helper import Auth | |
| def token_required(f): | |
| @wraps(f) | |
| def decorated(*args, **kwargs): | 
OlderNewer