API Reference
Server Side
Auth
Kernel API, reference: Auth
BaseAuth
Kernel API, reference: BaseAuth
AuthModel
Overview
AuthModel is the authenticator used in NocoBase applications (Authenticator, reference: AuthManager - setStorer and Auth - constructor) data model, providing some methods for interacting with the user data collection. In addition, methods provided by Sequelize Model can also be used.
Class Methods
-
findUser(uuid: string): UserModel- Query user byuuid.uuid- User unique identifier from the current authentication type
-
newUser(uuid: string, userValues?: any): UserModel- Create a new user, bind the user to the current authenticator throughuuid.uuid- User unique identifier from the current authentication typeuserValues- Optional. Other user information. When not passed,uuidwill be used as the user's nickname.
-
findOrCreateUser(uuid: string, userValues?: any): UserModel- Find or create a new user, the creation rule is the same as above.uuid- User unique identifier from the current authentication typeuserValues- Optional. Other user information.
Client Side
plugin.registerType()
Register the client of the authentication type.
Signature
registerType(authType: string, options: AuthOptions)
Type
Details
SignInForm- Sign in formSignInButton- Sign in (third-party) button, can be used as an alternative to the sign-in formSignUpForm- Sign up formAdminSettingsForm- Admin configuration form
Route
The frontend routes for registering the auth plugin are as follows:
-
Auth Layout
- name:
auth - path:
- - component:
AuthLayout
- name:
-
SignIn Page
- name:
auth.signin - path:
/signin - component:
SignInPage
- name:
-
SignUp Page
- name:
auth.signup - path:
/signup - component:
SignUpPage
- name:

