File tree 1 file changed +12
-7
lines changed
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"net/http"
6
6
7
+ "github.com/sirupsen/logrus"
7
8
"github.com/supabase/auth/internal/models"
8
9
"github.com/supabase/auth/internal/storage"
9
10
)
@@ -46,13 +47,17 @@ func (a *API) Logout(w http.ResponseWriter, r *http.Request) error {
46
47
return terr
47
48
}
48
49
49
- //exhaustive:ignore Default case is handled below.
50
- switch scope {
51
- case LogoutLocal :
52
- return models .LogoutSession (tx , s .ID )
53
-
54
- case LogoutOthers :
55
- return models .LogoutAllExceptMe (tx , s .ID , u .ID )
50
+ if s == nil {
51
+ logrus .Infof ("user has an empty session_id claim: %s" , u .ID )
52
+ } else {
53
+ //exhaustive:ignore Default case is handled below.
54
+ switch scope {
55
+ case LogoutLocal :
56
+ return models .LogoutSession (tx , s .ID )
57
+
58
+ case LogoutOthers :
59
+ return models .LogoutAllExceptMe (tx , s .ID , u .ID )
60
+ }
56
61
}
57
62
58
63
// default mode, log out everywhere
You can’t perform that action at this time.
0 commit comments