Repository navigation
Working with the authenticated user
After authentication, AuthUser gives our application a small identity object without exposing tokens or response ciphers. These examples run inside a handler from the Quick start guide.
if (!auth.isLoggedIn()) auth.login();
const user = auth.getAuthUser();The default redirect handler throws a control-flow signal. Runtime adapters catch it and send the redirect; execution does not continue into protected content. A custom redirect handler must preserve this behavior. Reading a user while logged out throws NotLoggedInException.
const { id, email } = auth.getAuthUser();Use the provider ID to associate local records. Email can change. Both properties are read-only. Updating local application data does not update the provider.
Login identifies a visitor. The application must still check access to each private record or action, for example by loading an order using both its ID and the authenticated user's ID.
Next, see Responding to a new authentication.
Authwave’s TypeScript client connects your Node.js, Express or Next.js application to an Authwave provider.