Remplacement de Redux/Saga par Apollo
This commit is contained in:
@ -33,7 +33,6 @@ func Mount(r *chi.Mux, config *config.Config) error {
|
||||
AllowCredentials: config.HTTP.CORS.AllowCredentials,
|
||||
Debug: config.Debug,
|
||||
}).Handler)
|
||||
r.Use(oidc.Middleware)
|
||||
r.Use(session.UserEmailMiddleware)
|
||||
|
||||
gql := handler.New(
|
||||
|
@ -21,7 +21,9 @@ func UserEmailMiddleware(next http.Handler) http.Handler {
|
||||
fn := func(w http.ResponseWriter, r *http.Request) {
|
||||
userEmail, err := GetUserEmail(w, r)
|
||||
if err != nil {
|
||||
panic(errors.Wrap(err, "could not find user email"))
|
||||
http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
ctx := WithUserEmail(r.Context(), userEmail)
|
||||
|
Reference in New Issue
Block a user