added prefix scan and fixed logout issue
This commit is contained in:
parent
4812a60367
commit
8143e484cd
12 changed files with 99 additions and 77 deletions
|
|
@ -25,6 +25,8 @@ const (
|
|||
totpClaim = "totp"
|
||||
rememberClaim = "remember"
|
||||
refererClaim = "referer"
|
||||
|
||||
empty = "(empty)"
|
||||
)
|
||||
|
||||
func newContext(w http.ResponseWriter, r *http.Request, s *HTTPServer) *Context {
|
||||
|
|
@ -211,6 +213,14 @@ func (c *Context) Var(name string) (ret string) {
|
|||
return
|
||||
}
|
||||
|
||||
func (c *Context) Forwarded() (ret string) {
|
||||
ret = c.Request.Header.Get("X-Forwarded-For")
|
||||
if ret == "" {
|
||||
ret = empty
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// CheckXsrf validates the xsrf token
|
||||
func (c *Context) CheckXsrf() (ok bool) {
|
||||
ok = checkXsrf(c.Form("token"), c.Token.RawSig()[:keySize])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue