MLH-Fellowship / fellow-central

Earn points for yourself and your pod during the MLH Fellowship. Make your activities and participation count.
https://leagueoffellow.netlify.app/
MIT License
6 stars 1 forks source link

Add JWT token support #41

Closed PawanKolhe closed 3 years ago

PawanKolhe commented 3 years ago

Description

JWT token sent back to user after login, which has the discord_id encoded in it. The frontend will use this token to make authenticated requests.

Example of Authenticated route

@app.route("/")
@jwt_required()
def foo():
    discord_id = get_jwt_identity()    # decoding payload from jwt token
    return f"Discord ID: {discord_id}"

Fixes #40

Type of change

Checklist:

gitpod-io[bot] commented 3 years ago