Minimize account sharing
Evaluate recent login activity and IP information to detect impossible travel or suspicious access.
Kinde · Const
The user:post_authentication workflow runs after single-factor authentication. Use it for post-login checks, user enrichment, organization assignment, and first-time-user handling before authorization continues.
This workflow runs after single-factor authentication and before the authorization flow completes. It receives an event containing request and context data, allowing you to perform checks, enrich users, assign organizations, or identify first-time Kinde users.
Trigger: `user:post_authentication`export default async function handler(event) {
const { request, context } = event;
return { ...context, firstTimeUser: request?.user?.isFirstTimeUser };
}A workflow handler receives the event object and can use its request and context data to apply post-authentication logic.
Evaluate recent login activity and IP information to detect impossible travel or suspicious access.
Set additional user properties before Kinde generates tokens.
Add an invited user to relevant organizations before authorization proceeds.
Branch application behavior when Kinde has created a user for the first time.
The trigger is user:post_authentication. It fires after a user completes single-factor authentication, such as with email and password or Google.
Follow-up: How would you modify token claims instead? Use the user token generation workflow and its accessToken or idToken bindings.
The workflow can inspect the event object, whose main argument has request and context keys. Those provide the trigger reason and additional relevant data points.
Follow-up: What should be inspected first when implementing a workflow? Start with the event shape and the fields exposed in request and context for the selected trigger.
Typical uses include checking suspicious or impossible travel, adding user properties before token generation, adding invited users to organizations, and determining whether the user is new to Kinde.
Follow-up: How can an application respond to a high-risk login? Perform the external risk check in the workflow and block access proactively when the risk is high.
user:pre_registrationuser:new_password_provideduser:tokens_generationkinde.accessTokenkinde.idToken