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: always issue session last #3876

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
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
7 changes: 6 additions & 1 deletion driver/registry_default_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ func (m *RegistryDefault) WithHooks(hooks map[string]func(config.SelfServiceHook
}

func (m *RegistryDefault) getHooks(credentialsType string, configs []config.SelfServiceHook) (i []interface{}) {
var addSessionIssuer bool
for _, h := range configs {
switch h.Name {
case hook.KeySessionIssuer:
i = append(i, m.HookSessionIssuer())
// The session issuer hook always needs to come last.
addSessionIssuer = true
case hook.KeySessionDestroyer:
i = append(i, m.HookSessionDestroyer())
case hook.KeyWebHook:
Expand Down Expand Up @@ -96,6 +98,9 @@ func (m *RegistryDefault) getHooks(credentialsType string, configs []config.Self
Errorf("A unknown hook was requested and can therefore not be used")
}
}
if addSessionIssuer {
i = append(i, m.HookSessionIssuer())
}

return i
}
Loading