Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing SessionIssued event for api flows #3348

Merged
merged 4 commits into from
Jun 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions selfservice/flow/login/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,15 @@ func (e *HookExecutor) PostLoginHook(
Info("Identity authenticated successfully and was issued an Ory Kratos Session Token.")

trace.SpanFromContext(r.Context()).AddEvent(events.NewLoginSucceeded(r.Context(), &events.LoginSucceededOpts{
SessionID: s.ID,
IdentityID: i.ID, FlowType: string(a.Type), RequestedAAL: string(a.RequestedAAL), IsRefresh: a.Refresh, Method: a.Active.String(),
SSOProvider: provider,
SessionID: s.ID,
IdentityID: i.ID,
FlowType: string(a.Type),
RequestedAAL: string(a.RequestedAAL),
IsRefresh: a.Refresh,
Method: a.Active.String(),
SSOProvider: provider,
}))
trace.SpanFromContext(r.Context()).AddEvent(events.NewSessionIssued(r.Context(), string(s.AuthenticatorAssuranceLevel), s.ID, s.IdentityID))
jonas-jonas marked this conversation as resolved.
Show resolved Hide resolved

if handled, err := e.d.SessionManager().MaybeRedirectAPICodeFlow(w, r, a, s.ID, g); err != nil {
return errors.WithStack(err)
Expand Down