Migration from cloudbase js sdk v1
Login Authentication
From v1 to v2, the Login Authentication module has the following changes:
- Login State Persistence: The login state only supports the
local
mode. - v2 version no longer supports monitoring changes in user login status.
- v2 version no longer supports Official Account login. If you need to use this method, please use the v1 version
- Simplified user field information. See User for details.
- Adjusted the account linking usage and no longer supports custom login association. For details, see Login Authentication v2 | Account Linking
- Adjusted the login usage. For details, see Login Authentication v2 | Login Authentication
Interface Changes
Auth
Updates
- Interface naming typo fixed: no longer use
Auth.getCurrenUser()
, please useAuth.getCurrentUser()
Additions
- Auth.bindEmail
- Auth.bindPhoneNumber
- Auth.bindWithProvider
- Auth.deleteMe
- Auth.genProviderRedirectUri
- Auth.getAccessToken
- Auth.getProviders
- Auth.getUserInfo
- Auth.getVerification
- Auth.grantProviderToken
- Auth.loginScope
- Auth.queryUser
- Auth.resetPassword
- Auth.setCustomSignFunc
- Auth.setPassword
- Auth.signIn
- Auth.signInAnonymously
- Auth.signInWithCustomTicket
- Auth.signInWithOpenId
- Auth.signInWithPhoneAuth
- Auth.signInWithProvider
- Auth.signInWithSms
- Auth.signInWithEmail
- Auth.signInWithUnionId
- Auth.signUp
- Auth.sudo
- Auth.unbindProvider
- Auth.verify
Deprecated
- Auth.anonymousAuthProvider
- Auth.customAuthProvider
- Auth.forceResetPwdByPhoneCode
- Auth.getAuthHeader
- Auth.getAuthHeaderAsync
- Auth.onAccessTokenRefreshed
- Auth.onAnonymousConverted
- Auth.onLoginStateExpired
- Auth.onLoginTypeChanged
- Auth.sendPasswordResetEmail
- Auth.sendPhoneCode
- Auth.shouldRefreshAccessToken
- Auth.signInWithEmailAndPassword
- Auth.signInWithPhoneCodeOrPassword
- Auth.signInWithUsernameAndPassword
- Auth.signUpWithEmailAndPassword
- Auth.signUpWithPhoneCode
- Auth.weixinAuthProvider
LoginState
Deprecated
- LoginState.isAnonymousAuth
- LoginState.isCustomAuth
- LoginState.isUsernameAuth
- LoginState.isWeixinAuth
- LoginState.loginType
User
Deprecated
- User.avatarUrl
- User.linkWithPhoneNumber
- User.nickName
- User.updateEmail
- User.updatePassword
- User.updatePhoneNumber
- User.updateUsername