Implement JWT authentication
We want backend to be able to generate and decode JWT from authentication header.
We can use PyJWT package
Implementation expectations:
- Add a
api/v2/generate-token
route. It will be called as callback_url during oauth user authentication. It should build a token with this payload pattern:
{
user_id: int,
deprecatedAt: string
}
- Add a
validate_token
decorator. It will decode a provided jwt and check if not deprecated.
Edited by Léo Mouyna