@davimacedo So my situation is a bit more complex regarding this. I dont actually make use of Parse.login
I basically auth the user on a 3rd party site then if that successful i return the user object including the sessionToken then client side I use become(SessionToken), is there anyway to become and also to specify the installationId
some pseudo code of the auth im working with
const {email, password, type, mailist } = request.params
let endpoint: string
if (!email || !password || !type) throw 'invalid request';
// other auth logic via another endpoint happens here
const provider = {
authenticate: () => Promise.resolve(),
restoreAuthentication() { return true; },
getAuthType() { return 'myAuth'; },
getAuthData() {
return {
authData: {
uid: wpUser.uId,
id: wpUser.user_nicename,
token: wpUser.token,
referralCode: wpUser.referralCode
},
};
},
};
Parse.User._registerAuthenticationProvider(provider);
const user: Parse.User & any = new Parse.User(); // added any because of issue with _linkWith and linkWith
user.setPassword(password); // store this so we can easily migrate later
await user._linkWith(provider.getAuthType(), provider.getAuthData())
user._isLinked(provider)
return user
} catch (error: any) {
throw error;
}