auto logout

This commit is contained in:
Alireza Ahmadi
2024-02-27 01:03:00 +01:00
parent e91d8038ad
commit 19a6053098
6 changed files with 26 additions and 10 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ func pureJsonMsg(c *gin.Context, success bool, msg string) {
func checkLogin(c *gin.Context) {
if !IsLogin(c) {
if c.GetHeader("X-Requested-With") == "XMLHttpRequest" {
pureJsonMsg(c, false, "Not authorized")
pureJsonMsg(c, false, "Invalid login")
} else {
c.Redirect(http.StatusTemporaryRedirect, "/login")
}