Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return full response object after authentication #110

Merged
merged 1 commit into from
May 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion session/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ module.exports = connect.behavior('data/feathers-session', function (base) {
var requestData = convertLocalAuthData(data);
return feathersClient.authenticate(requestData)
.then(function (response) {
return response.accessToken ? decode(response.accessToken) : response;
if (response.accessToken) {
Object.assign(response, decode(response.accessToken));
}
return response;
});
},
getData: function () {
Expand Down
1 change: 1 addition & 0 deletions session/session_tests-x-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ module.exports = function runSessionTests (options) {
session.save()
.then(function (res) {
assert.ok(res._id, 'Got session data back');
assert.ok(res.accessToken, 'Got full response data back');
Session.get()
.then(function (res) {
assert.ok(res._id, 'Session.get returned session data');
Expand Down