Skip to content

Commit

Permalink
Create RefreshAccessToken resource
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Jun 16, 2021
1 parent 6810fde commit 544375a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/webqueue2api/api/resources/refresh_access_token.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from flask_restful import Resource
from flask_jwt_extended import jwt_refresh_token_required, get_jwt_identity, create_access_token

class RefreshAccessToken(Resource):
@jwt_refresh_token_required
def post(self):
username = get_jwt_identity()
access_token = create_access_token(username)
return ({"access_token": access_token}, 200)

0 comments on commit 544375a

Please sign in to comment.