mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 19:47:07 +09:00
fix(api): allow bots with pending password changes (#39551)
Allow bot accounts to use the API when a legacy password-change flag is set, since bots cannot complete the interactive password-change flow. Preserve password-change enforcement for human accounts and restrictions for inactive or prohibited accounts. Fixes: https://github.com/go-gitea/gitea/issues/39542 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
11 files changed
+129
-100
No files matched your search
@@ -69,7 +69,7 @@ func (c TemplateContext) CurrentWebTheme() *webtheme.ThemeMetaInfo {
|
||||
|
||||
func (c TemplateContext) ImpersonatedUser() *user_model.User {
|
||||
webCtx := GetWebContext(c)
|
||||
if webCtx == nil || webCtx.Doer == nil || !webCtx.DoerIsImpersonated() {
|
||||
if webCtx == nil || webCtx.Doer == nil || !IsDoerSessionImpersonated(webCtx.Session) {
|
||||
return nil
|
||||
}
|
||||
return webCtx.Doer
|
||||
|
||||
Reference in new issue
Block a user