skapi-js 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/skapi.js +1 -1
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.module.js +1 -1
- package/dist/skapi.module.js.map +1 -1
- package/js/main/skapi.js +1 -1
- package/js/methods/user.js +14 -14
- package/package.json +1 -1
package/js/main/skapi.js
CHANGED
package/js/methods/user.js
CHANGED
|
@@ -369,7 +369,7 @@ export async function signup(form, option) {
|
|
|
369
369
|
params.owner = this.__user.user_id;
|
|
370
370
|
}
|
|
371
371
|
else {
|
|
372
|
-
if (params.access_group) {
|
|
372
|
+
if (!is_admin && params.access_group) {
|
|
373
373
|
throw new SkapiError('Only admins can set "access_group" parameter.', { code: 'INVALID_PARAMETER' });
|
|
374
374
|
}
|
|
375
375
|
await this.logout();
|
|
@@ -419,20 +419,20 @@ export async function signup(form, option) {
|
|
|
419
419
|
delete params.service;
|
|
420
420
|
delete params.owner;
|
|
421
421
|
}
|
|
422
|
-
let resp = await request.bind(this)("signup", params, { auth:
|
|
423
|
-
if (
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
return
|
|
422
|
+
let resp = await request.bind(this)("signup", params, { auth: is_admin });
|
|
423
|
+
if (!is_admin) {
|
|
424
|
+
if (signup_confirmation) {
|
|
425
|
+
let u = await authentication.bind(this)().createCognitoUser(params.username || params.email);
|
|
426
|
+
cognitoUser = u.cognitoUser;
|
|
427
|
+
this.__request_signup_confirmation = u.cognitoUsername;
|
|
428
|
+
return "SUCCESS: The account has been created. User's signup confirmation is required.";
|
|
429
|
+
}
|
|
430
|
+
if (logUser) {
|
|
431
|
+
return login.bind(this)({ email: params.username || params.email, password: params.password });
|
|
432
|
+
}
|
|
433
|
+
return 'SUCCESS: The account has been created.';
|
|
434
434
|
}
|
|
435
|
-
return
|
|
435
|
+
return resp;
|
|
436
436
|
}
|
|
437
437
|
export async function disableAccount() {
|
|
438
438
|
await this.__connection;
|
package/package.json
CHANGED