Skip to content

Commit

Permalink
Merge pull request #38 from kinde-oss/feat/new_password_provided
Browse files Browse the repository at this point in the history
Feat/new password provided
  • Loading branch information
DanielRivers authored Jan 16, 2025
2 parents 94035c6 + df220ad commit cb97223
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ export enum WorkflowTrigger {
UserTokenGeneration = "user:tokens_generation",
M2MTokenGeneration = "m2m:token_generation",
ExistingPasswordProvided = "user:existing_password_provided",
NewPasswordProvided = "user:new_password_provided",
}

export type WorkflowEvents =
| onUserTokenGeneratedEvent
| onM2MTokenGeneratedEvent
| onExistingPasswordProvided;
| onExistingPasswordProvided
| onNewPasswordProvided;

type EventBase = {
request: RequestContext;
Expand Down Expand Up @@ -146,6 +148,22 @@ export type onExistingPasswordProvided = EventBase & {
};
};

export type onNewPasswordProvided = EventBase & {
context: {
auth: {
firstPassword: string; // the first password entered
secondPassword: string; // password match field
newPasswordReason: "reset" | "initial"; // whether it is registration or reset
};
user: {
id: string;
};
workflow: {
trigger: WorkflowTrigger.NewPasswordProvided;
};
};
};

export type onM2MTokenGeneratedEvent = EventBase & {
context: {
workflow: {
Expand Down

0 comments on commit cb97223

Please sign in to comment.