Overview
Authentication server actions handle user registration, session management, and profile updates in VizBoard.SignUp
Creates a new user account with email and password authentication.Parameters
Response
Indicates if the registration was successful
Success or error messagePossible messages:
"User registered successfully"- Registration succeeded"This email is already registered."- Email already exists"This email is already registered with Google or GitHub..."- OAuth conflict
Example
getUserByEmail
Retrieves a user by their email address.Parameters
The email address to search for
Response
Returns aUser object if found, or null if no user exists with that email.
Unique user identifier
User’s email address
User’s first name
User’s last name
Hashed password (null for OAuth users)
Example
getUserBySession
Retrieves the currently authenticated user from the session.Response
Indicates if the user was retrieved successfully
The authenticated user object (only present when
success is true)Error message (only present when
success is false)Possible values:"Not authenticated"- No active session"Error fetching user"- Database error
Example
updateUserName
Updates the user’s first and last name.Parameters
The ID of the user to update
Response
Indicates if the update was successful
Success or error message
Example
This action automatically revalidates the
/settings path.updateUserEmail
Updates the user’s email address.Parameters
The ID of the user to update
Response
Indicates if the update was successful
Success or error message
Example
updateUserPassword
Updates the user’s password after verifying the current password.Parameters
The ID of the user to update
The user’s current hashed password (null for OAuth users)
Response
Indicates if the update was successful
Success or error messagePossible messages:
"Password updated successfully""You are connected with a social account""Current password is not correct""New password must be different from current password"
Example
deleteUserAccount
Permanently deletes a user account and clears their session.Parameters
The ID of the user to delete
Response
Indicates if the deletion was successful
Success or error message
