@cloudbase/auth 2.25.11 → 2.26.0
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/cjs/index.js +18 -9
- package/dist/cjs/type.d.ts +3 -0
- package/dist/cjs/type.js +1 -1
- package/dist/esm/index.js +18 -9
- package/dist/esm/type.d.ts +3 -0
- package/dist/esm/type.js +1 -1
- package/dist/miniprogram/index.js +1 -1
- package/package.json +5 -5
- package/src/index.ts +7 -0
- package/src/type.ts +3 -0
package/src/index.ts
CHANGED
|
@@ -1574,6 +1574,13 @@ class Auth {
|
|
|
1574
1574
|
* @returns Promise<SignInWithOtpRes>
|
|
1575
1575
|
*/
|
|
1576
1576
|
async signInWithOtp(params: SignInWithOtpReq): Promise<SignInWithOtpRes> {
|
|
1577
|
+
if (params.options?.shouldCreateUser === undefined || !!params.options?.shouldCreateUser) {
|
|
1578
|
+
return this.signUp({
|
|
1579
|
+
email: params.email,
|
|
1580
|
+
phone: params.phone,
|
|
1581
|
+
})
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1577
1584
|
try {
|
|
1578
1585
|
// 参数校验:email或phone必填其一
|
|
1579
1586
|
this.validateAtLeastOne(params, [['email'], ['phone']], 'You must provide either an email or phone number')
|
package/src/type.ts
CHANGED