diff --git a/server/middlewares.go b/server/middlewares.go index 5e594b7..5d088f7 100644 --- a/server/middlewares.go +++ b/server/middlewares.go @@ -132,7 +132,13 @@ func checkSessionMiddleware(handler http.Handler) http.Handler { return } acc, err := store.FindAccountByPasskeyId(session.UserID) - if err != nil { + switch err { + case storage.ErrEntryNotFound: + log.Info().Msg("No account for the given passkey id found. It probably got deleted") + handler.ServeHTTP(w, r) + return + case nil: + default: // Failed to get account for passkey id. Log, then move on as if no session is set log.Error(). Err(err).