Skip to content

Commit 25dde2a

Browse files
committed
fix: provider may not even suppport signout
1 parent 8a55865 commit 25dde2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

goic.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,19 +433,19 @@ func (g *Goic) SignOut(tok *Token, redir string, res http.ResponseWriter, req *h
433433
}
434434
}
435435

436-
name := tok.Provider
437-
if !g.Supports(name) {
436+
p, ok := g.providers[tok.Provider]
437+
if !ok || p.wellKnown.SignOutURI == "" {
438438
return ErrProviderSupport
439439
}
440440

441441
tk := tok.AccessToken
442442
if tk == "" && tok.RefreshToken != "" {
443443
tk = tok.RefreshToken
444-
} else {
444+
}
445+
if tk == "" {
445446
return ErrTokenAccessKey
446447
}
447448

448-
p := g.providers[tok.Provider]
449449
redirect, err := http.NewRequest("GET", p.wellKnown.SignOutURI, nil)
450450
if err != nil {
451451
return err

0 commit comments

Comments
 (0)