feat(admin): authorize batch purchase starts
This commit is contained in:
@@ -62,6 +62,12 @@ func (manager *Manager) Ensure(writer http.ResponseWriter, request *http.Request
|
||||
return current.csrfToken, false
|
||||
}
|
||||
|
||||
// IsAuthenticated 只读检查当前请求是否持有有效管理会话;它不会像 Ensure 一样创建匿名会话。
|
||||
func (manager *Manager) IsAuthenticated(request *http.Request) bool {
|
||||
_, current, found := manager.current(request)
|
||||
return found && current.authenticated
|
||||
}
|
||||
|
||||
// VerifyCSRF 只接受当前未过期会话中以恒定时间比较匹配的 token。
|
||||
func (manager *Manager) VerifyCSRF(request *http.Request, token string) (authenticated bool, ok bool) {
|
||||
_, current, found := manager.current(request)
|
||||
|
||||
Reference in New Issue
Block a user