Skip to content

Account Activation

Activates an account using the ID received from email.

Usage

Node.js / Next.js

const response = await provider.auth.activate('<activation_id>');

Express.js Requires useProductFlame middleware.

app.get('/activate/:id', async (req, res) => {
// Automatically sets the auth cookie
const response = await req.auth.activate(req.params.id);
res.json(response);
});

Arguments

NameTypeDescription
activationIdstringRequired. The 24-character ID received in the activation email.

Response

Type: Promise<{ token: string }>

Returns the session token upon successful activation.

Note: Next.js and Express.js SDKs automatically handle setting the session cookie for you.

Errors

  • BAD_REQUEST: The activationId is invalid.
  • REQUEST_EXPIRED: The email verification request has expired.
  • UNKNOWN_ERROR: An unknown error has occured.