store auth information with session

This commit is contained in:
2023-09-14 12:45:21 +08:00
parent 79bbf4a39c
commit 8eb72831c1
12 changed files with 110 additions and 53 deletions

View File

@@ -1,6 +1,8 @@
package controller
import "regexp"
import (
"regexp"
)
const (
Success = 0
@@ -11,10 +13,12 @@ const (
TokenFormatError = 5
FrpServerError = 6
AuthPrefix = "Basic "
LoginUrl = "/login"
LogoutUrl = "/logout"
LoginSuccessUrl = "/"
SessionName = "GOSESSION"
AuthName = "_PANEL_AUTH"
LoginUrl = "/login"
LoginSuccessUrl = "/"
LogoutUrl = "/logout"
LogoutSuccessUrl = "/login"
)
var (
@@ -38,6 +42,7 @@ type CommonInfo struct {
PluginPort int
User string
Pwd string
KeepTime int
DashboardTLS bool
DashboardAddr string
DashboardPort int
@@ -95,3 +100,7 @@ type TokenDisable struct {
type TokenEnable struct {
TokenDisable
}
func (e *HTTPError) Error() string {
return e.Err.Error()
}