Skip to content

Commit 15ba4ef

Browse files
committed
Use http.StatusFound so user-agent will still hit not right endpoint.
1 parent 61a4557 commit 15ba4ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

middlewares/auth/auth.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ func authenticator(c *gin.Context) (interface{}, error) {
6565
}
6666

6767
func loginResponse(c *gin.Context, code int, token string, expire time.Time) {
68-
c.Redirect(http.StatusMovedPermanently, "/")
68+
c.Redirect(http.StatusFound, "/")
6969
}
7070

7171
func logoutResponse(c *gin.Context, code int) {
72-
c.Redirect(http.StatusMovedPermanently, "/login")
72+
c.Redirect(http.StatusFound, "/login")
7373
}
7474

7575
func unauthorized(c *gin.Context, code int, message string) {
76-
c.Redirect(http.StatusMovedPermanently, "/login")
76+
c.Redirect(http.StatusFound, "/login")
7777
}

0 commit comments

Comments
 (0)