Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upfeat: consistent response return between local and jwt strategy #2042
Conversation
Currently, when /authentication service is trigger with 'local' strategy, it is missing `authentication.accessToken` and `authentication.payload` field as compared to 'jwt' strategy This commit attempts to ensure consistency in both response
Currently, when /authentication service is trigger with
localstrategy, it is missingauthentication.accessTokenandauthentication.payloadfield as compared tojwtstrategyThis commit attempts to ensure consistency in both response
// response from 'jwt' strategy { "accessToken": "<token>", "authentication": { "strategy": "local", "accessToken": "<token>", "payload": { "iat": 1597565489, "exp": 1597651889, "aud": "https://yourdomain.com", "iss": "feathers", "sub": "5edb8a3f8a2e8936c429d5ba", "jti": "e64f9caa-e738-47da-9c27-fe8c026ab627" } }, "user": { "_id": "123456", "email": "helloworld@gmail.com", "createdAt": "2020-06-06T12:21:19.167Z", "updatedAt": "2020-06-06T12:24:55.164Z", "__v": 0 } } // response from 'local' strategy (before) { "accessToken": "<token>", "authentication": { "strategy": "local" }, "user": { "_id": "123456", "email": "helloworld@gmail.com", "createdAt": "2020-06-06T12:21:19.167Z", "updatedAt": "2020-06-06T12:24:55.164Z", "__v": 0 } } // response from 'local' strategy (after) { "accessToken": "<token>", "authentication": { "strategy": "local" "accessToken": "<token>", "payload": { "iat": 1597565489, "exp": 1597651889, "aud": "https://yourdomain.com", "iss": "feathers", "sub": "5edb8a3f8a2e8936c429d5ba", "jti": "e64f9caa-e738-47da-9c27-fe8c026ab627" } }, "user": { "_id": "123456", "email": "helloworld@gmail.com", "createdAt": "2020-06-06T12:21:19.167Z", "updatedAt": "2020-06-06T12:24:55.164Z", "__v": 0 } }I added in
authenticationpackage instead ofauthentication-localbecausejsonwebtokenis already available and it seem like the correct place to add