mirror of
https://github.com/nais/wonderwall.git
synced 2026-05-06 08:27:10 +00:00
feat(handler/login): log existing sid on prompt
This commit is contained in:
@@ -156,6 +156,10 @@ func (s *Standalone) Login(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
sess, _ := s.SessionManager.Get(r)
|
||||
if sess != nil {
|
||||
if sid := sess.ExternalSessionID(); sid != "" {
|
||||
fields["sid"] = sid
|
||||
}
|
||||
|
||||
err := s.SessionManager.Delete(r.Context(), sess)
|
||||
if err != nil && !errors.Is(err, session.ErrNotFound) {
|
||||
s.InternalError(w, r, fmt.Errorf("login: destroying session: %w", err))
|
||||
|
||||
@@ -84,7 +84,11 @@ func (in *Session) AuthTime() string {
|
||||
}
|
||||
|
||||
func (in *Session) ExternalSessionID() string {
|
||||
return in.data.ExternalSessionID
|
||||
if in.data != nil {
|
||||
return in.data.ExternalSessionID
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func (in *Session) IDToken() string {
|
||||
|
||||
Reference in New Issue
Block a user