pallets-eco / flask-jwt

JWT (JSON Web Tokens) for Flask applications
MIT License
564 stars 177 forks source link

Custom username and password key for auth payload #31

Closed sankethkatta closed 9 years ago

sankethkatta commented 10 years ago

Hello, I added config options to parameterize the payload of JWTAuthView. Currently, it expects a payload of:

{
  "username": "johnsmith",
  "password": "hunter2"
}

With this change, one could customize those keys to accept the following payload:

app.config['JWT_AUTH_USERNAME_KEY'] = 'email'
app.config['JWT_AUTH_PASSWORD_KEY'] = 'pass'
{
  "email": "johnsmith@foo.com",
  "pass": "hunter2"
}
coveralls commented 10 years ago

Coverage Status

Coverage remained the same when pulling 9f4f3bc8dce9da5dd8a567dfada0854e0cf656ae on sankethkatta:master into 0789fd7578eff43bc7a62c1083b069d0a5cf73ac on mattupstate:master.

flypunk commented 9 years ago

Hi Matt, Please merge this commit - I need it too.