mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 05:08:36 +08:00
Snapshots: Fix usage of sign in link from the snapshot page (#31986)
Fix redirect to login page from snapshot page when not authenticated. Fixes #28547
This commit is contained in:

committed by
GitHub

parent
669a616797
commit
a97637a133
@ -18,6 +18,7 @@ var plog = log.New("api")
|
||||
|
||||
// registerRoutes registers all API HTTP routes.
|
||||
func (hs *HTTPServer) registerRoutes() {
|
||||
reqNoAuth := middleware.NoAuth()
|
||||
reqSignedIn := middleware.ReqSignedIn
|
||||
reqSignedInNoAnonymous := middleware.ReqSignedInNoAnonymous
|
||||
reqGrafanaAdmin := middleware.ReqGrafanaAdmin
|
||||
@ -118,7 +119,7 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
r.Post("/api/user/password/reset", bind(dtos.ResetUserPasswordForm{}), routing.Wrap(ResetPassword))
|
||||
|
||||
// dashboard snapshots
|
||||
r.Get("/dashboard/snapshot/*", hs.Index)
|
||||
r.Get("/dashboard/snapshot/*", reqNoAuth, hs.Index)
|
||||
r.Get("/dashboard/snapshots/", reqSignedIn, hs.Index)
|
||||
|
||||
// api renew session based on cookie
|
||||
|
Reference in New Issue
Block a user