diff --git a/base/go/frontend_server.go b/base/go/frontend_server.go index 43786917..b2df8e49 100644 --- a/base/go/frontend_server.go +++ b/base/go/frontend_server.go @@ -497,6 +497,22 @@ func FrontendServer(info *FrontendInfo, embedfs *embed.FS) error { // Redirect to self, this is due to the "root" not being / for all apps http.Redirect(w, r, info.Self, http.StatusFound) }) + + // Handle logout + http.HandleFunc(prefix+"/auth/oidc/logout", func(w http.ResponseWriter, r *http.Request) { + // Delete the auth cookie + http.SetCookie(w, &http.Cookie{ + Name: frontendAuthCookieKey, + Value: "", + Path: "/", + MaxAge: -1, + // secure if self is https + Secure: strings.HasPrefix(info.Self, "https://"), + }) + + // Redirect to self, this is due to the "root" not being / for all apps + http.Redirect(w, r, info.Self, http.StatusFound) + }) } var handler http.Handler = nil diff --git a/tools/mothership/admin/ui/App.tsx b/tools/mothership/admin/ui/App.tsx index 577d338b..911922e6 100644 --- a/tools/mothership/admin/ui/App.tsx +++ b/tools/mothership/admin/ui/App.tsx @@ -46,6 +46,9 @@ export const App = () => { Mship Admin +