Adds privateId param to login call so we can set it for existing users if need be
@@ -345,14 +345,17 @@ export function transferPrivateAccount(credentials) {
* @returns {*}
*/
export function login(credentials) {
- const { email, password, rememberMe } = parseCredentials(credentials);
+ const { email, password, rememberMe, privateId } = parseCredentials(
+ credentials
+ );
const loginUrl = urljoin(ownerBaseUrl, "/rest/users/signin");
const params =
"username=" +
encodeURIComponent(email) +
"&password=" +
encodeURIComponent(password) +
- (rememberMe ? "&remember-me=true" : "");
+ (rememberMe ? "&remember-me=true" : "") +
+ (privateId ? "&privateId=" + privateId : "");
return fetch(loginUrl, {
method: "post",
@@ -400,6 +403,7 @@ export function privateId2Credentials(privateId) {
return {
email,
password,
+ privateId,
};
}
