Properly sets installationId on creating session with 3rd party auth
This commit is contained in:
@@ -204,13 +204,11 @@ describe('OAuth', function() {
|
|||||||
myoauth: getMockMyOauthProvider().authData
|
myoauth: getMockMyOauthProvider().authData
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var headers = {'X-Parse-Application-Id': 'test',
|
|
||||||
'X-Parse-REST-API-Key': 'rest',
|
|
||||||
'Content-Type': 'application/json' }
|
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
headers: {'X-Parse-Application-Id': 'test',
|
headers: {'X-Parse-Application-Id': 'test',
|
||||||
'X-Parse-REST-API-Key': 'rest',
|
'X-Parse-REST-API-Key': 'rest',
|
||||||
|
'X-Parse-Installation-Id': 'yolo',
|
||||||
'Content-Type': 'application/json' },
|
'Content-Type': 'application/json' },
|
||||||
url: 'http://localhost:8378/1/users',
|
url: 'http://localhost:8378/1/users',
|
||||||
body: JSON.stringify(jsonBody)
|
body: JSON.stringify(jsonBody)
|
||||||
@@ -224,9 +222,19 @@ describe('OAuth', function() {
|
|||||||
createOAuthUser((error, response, body) => {
|
createOAuthUser((error, response, body) => {
|
||||||
expect(error).toBe(null);
|
expect(error).toBe(null);
|
||||||
var b = JSON.parse(body);
|
var b = JSON.parse(body);
|
||||||
|
ok(b.sessionToken);
|
||||||
expect(b.objectId).not.toBeNull();
|
expect(b.objectId).not.toBeNull();
|
||||||
expect(b.objectId).not.toBeUndefined();
|
expect(b.objectId).not.toBeUndefined();
|
||||||
done();
|
var sessionToken = b.sessionToken;
|
||||||
|
var q = new Parse.Query("_Session");
|
||||||
|
q.equalTo('sessionToken', sessionToken);
|
||||||
|
q.first({useMasterKey: true}).then((res) => {
|
||||||
|
expect(res.get("installationId")).toEqual('yolo');
|
||||||
|
done();
|
||||||
|
}).fail((err) => {
|
||||||
|
fail('should not fail fetching the session');
|
||||||
|
done();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ RestWrite.prototype.transformUser = function() {
|
|||||||
'authProvider': this.storage['authProvider'] || 'password'
|
'authProvider': this.storage['authProvider'] || 'password'
|
||||||
},
|
},
|
||||||
restricted: false,
|
restricted: false,
|
||||||
installationId: this.data.installationId,
|
installationId: this.auth.installationId,
|
||||||
expiresAt: Parse._encode(expiresAt)
|
expiresAt: Parse._encode(expiresAt)
|
||||||
};
|
};
|
||||||
if (this.response && this.response.response) {
|
if (this.response && this.response.response) {
|
||||||
|
|||||||
@@ -27,17 +27,7 @@ export class UsersRouter extends ClassesRouter {
|
|||||||
req.body = data;
|
req.body = data;
|
||||||
req.params.className = '_User';
|
req.params.className = '_User';
|
||||||
|
|
||||||
//req.config.userController.setEmailVerifyToken(req.body);
|
|
||||||
|
|
||||||
return super.handleCreate(req);
|
return super.handleCreate(req);
|
||||||
|
|
||||||
// if (req.config.verifyUserEmails) {
|
|
||||||
// // Send email as fire-and-forget once the user makes it into the DB.
|
|
||||||
// p.then(() => {
|
|
||||||
// req.config.userController.sendVerificationEmail(req.body);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// return p;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleUpdate(req) {
|
handleUpdate(req) {
|
||||||
|
|||||||
Reference in New Issue
Block a user