Skip to main content

NAuthAdminEndpoints

Package: @nauth-toolkit/client Type: Interface

Admin endpoint paths configuration for the client SDK. Allows overriding default admin endpoint paths to match custom backend routes.

import { NAuthAdminEndpoints } from '@nauth-toolkit/client';

Properties

PropertyTypeDescription
deleteUserstringDELETE endpoint for user deletion (supports :sub path parameter)
disableUserstringPOST endpoint for disabling a user (supports :sub path parameter)
enableUserstringPOST endpoint for enabling a user (supports :sub path parameter)
forcePasswordChangestringPOST endpoint for forcing password change (supports :sub path parameter)
getAuditHistorystringGET endpoint for audit history
getMfaStatusstringGET endpoint for MFA status (supports :sub path parameter)
getMfaDevicesstringGET endpoint for MFA devices (supports :sub path parameter)
getUserstringGET endpoint for retrieving a user (supports :sub path parameter)
getUserSessionsstringGET endpoint for user sessions (supports :sub path parameter)
getUsersstringGET endpoint for querying users
logoutAllstringPOST endpoint for logging out all sessions (supports :sub path parameter)
removeMfaDeviceByIdstringDELETE endpoint for removing single MFA device by ID
setPreferredMfaDevicestringPOST endpoint for setting preferred MFA device
resetPasswordInitiatestringPOST endpoint for initiating password reset
setMfaExemptionstringPOST endpoint for setting MFA exemption
setPasswordstringPOST endpoint for setting password
signupstringPOST endpoint for user creation
signupSocialstringPOST endpoint for social user import

Default Endpoints

EndpointDefault Path
deleteUser/users/:sub
disableUser/users/:sub/disable
enableUser/users/:sub/enable
forcePasswordChange/users/:sub/force-password-change
getAuditHistory/audit/history
getMfaStatus/users/:sub/mfa/status
getMfaDevices/users/:sub/mfa/devices
getUser/users/:sub
getUserSessions/users/:sub/sessions
getUsers/users
logoutAll/users/:sub/logout-all
removeMfaDeviceById/mfa/devices/:deviceId
setPreferredMfaDevice/users/:sub/mfa/devices/:deviceId/preferred
resetPasswordInitiate/reset-password/initiate
setMfaExemption/mfa/exemption
setPassword/set-password
signup/signup
signupSocial/signup-social

Example

Override specific endpoints:

const client = new NAuthClient({
baseUrl: 'https://api.example.com/auth',
tokenDelivery: 'cookies',
admin: {
pathPrefix: '/admin',
endpoints: {
signup: '/users/create',
getUser: '/users/:sub/details',
deleteUser: '/users/:sub/remove',
},
},
});

Used By