Managing the currently authenticated user
auth
and tenants
modules.
/api/me
) and does not support administrative actions like creating or managing other users. Creating users would be done by the user via nile.auth.signUp()
, and managing users that are not yourself is not yet support.nile.users.getSelf()
method retrieves the profile of the currently authenticated user. Internally, this maps to a GET /api/me
request.
This is typically used to display account settings, personalize the UI, or check tenant memberships after a login.
User
object or raw Response
:
nile.users.updateSelf()
method allows the currently authenticated user to update their own profile using PUT /api/me
.
Use this to let users edit profile settings like name or profile picture. Fields not included in the update are left unchanged.
name
: Full display name of the userfamilyName
: Surname or last namegivenName
: First namepicture
: Optional URL to an avatar or profile imageemailVerified
: The date when the email was verifiedemail
, tenants
, created
, updated
, or id
.DELETE /api/me
request.
This is a soft delete operation — the user will no longer be able to sign in, but their historical data may still exist in the system for audit purposes. This action also clears all authentication headers that are maintained server-side. It would be necessary remove client side cookies as well for completeness.
Response
object:
200 OK
if the user was successfully marked for deletion401 Unauthorized
if not logged in404 Not Found
if the user does not exist/auth/verify-email
.
In production, this sends an email containing a link to verify the account, if configured. In development or testing, it can optionally skip the email step and mark the user as verified.
callbackUrl
: Optional. Where to redirect the user after successful verification.bypassEmail
: Optional. If true
, skips the email and sets emailVerified = true
directly.bypassEmail
is used, resolves to the updated User
object.Response
from the verification endpoint.nile.auth.signUp()
and nile.auth.signIn()
for authentication, and manage other users through tenant-related APIs where applicable.