Verify user is Logged In
Best way to set this up is to initially create a schema for the Token in
schema.py
We will then modify the file
oauth2.py
The
verify_access_token
function decodes the token by using the secret key and encryption algorithm and returns the data that was sent initiallyIf there is no user id, this will return a exception
Within the
get_current_user
function, we are defining the HTTP exception (our case 401)Then calling the
verify_access_token
function and providing the tokenThe invoked function returns the
token_data
Last updated