mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🔒 改进访问授权验证码安全性 Fix https://github.com/siyuan-note/siyuan/issues/5452
This commit is contained in:
parent
9f7d2182be
commit
20930e0f69
2 changed files with 17 additions and 12 deletions
|
|
@ -22,16 +22,16 @@ import (
|
|||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// SessionData represents the session.
|
||||
type SessionData struct {
|
||||
ID int
|
||||
AccessAuthCode string
|
||||
WrongAuthCount int
|
||||
Captcha string
|
||||
var WrongAuthCount int
|
||||
|
||||
func NeedCaptcha() bool {
|
||||
return 3 < WrongAuthCount
|
||||
}
|
||||
|
||||
func (sd *SessionData) NeedCaptcha() bool {
|
||||
return 3 < sd.WrongAuthCount
|
||||
// SessionData represents the session.
|
||||
type SessionData struct {
|
||||
AccessAuthCode string
|
||||
Captcha string
|
||||
}
|
||||
|
||||
// Save saves the current session of the specified context.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue