Skip to content

Commit

Permalink
fix: add login succeeded event to post registration hook
Browse files Browse the repository at this point in the history
  • Loading branch information
sashatalalasha authored and aeneasr committed Feb 5, 2024
1 parent 12166b4 commit 8a59804
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions selfservice/flow/registration/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,20 @@ func (e *HookExecutor) PostRegistrationHook(w http.ResponseWriter, r *http.Reque
return err
}

e.d.Audit().
WithRequest(r).
WithField("session_id", s.ID).
WithField("identity_id", i.ID).
Info("Identity authenticated successfully and was issued an Ory Kratos Session Token.")

span.AddEvent(events.NewLoginSucceeded(r.Context(), &events.LoginSucceededOpts{
SessionID: s.ID,
IdentityID: i.ID,
FlowType: string(registrationFlow.Type),
Method: registrationFlow.Active.String(),
SSOProvider: provider,
}))

e.d.Logger().
WithRequest(r).
WithField("identity_id", i.ID).
Expand Down

0 comments on commit 8a59804

Please sign in to comment.