API reference
Auth, permissions and API
Composables to call your API, check permissions, manage roles and sign in with social providers.
The Authentication, Roles and permissions and Connect your API guides show them in context.
useApi()
A $fetch instance with NUXT_PUBLIC_API_BASE, the auth-token bearer header and sign-out on 401.
useApi(): any
toFormSubmitError()
Turns a 422 response { message, errors } into a FormSubmitError for useFormSubmit().
toFormSubmitError(error: unknown): any
useCan()
can(permission) answers whether the current role has a permission; role is the full role.
useCan(): { role: any; can: (permission?: Permission) => any; }Returns
rolecanuseRoles()
Roles and team members: find, name, save and remove roles, assign them and manage invitations.
useRoles(): { roles: any; members: any; findRole: (id: string | undefined) => any; roleName: (role: RoleModel | undefined) => any; roleDescription: (role: RoleModel | undefined) => any; membe…Returns
rolesmembersfindRoleroleNameroleDescriptionmemberCountsaveRoleremoveRolenextRoleIdassignRoleinviteMemberresendInviteremoveMembersuseSocialSignIn()
signIn(method) signs in with a provider or a passkey and goes to the target route; loading is the method in progress.
useSocialSignIn(target: MaybeRefOrGetter<string>): { loading: any; signIn: (method: AuthSignInMethod) => Promise<void>; }Returns
loadingsignIn