mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-02 13:44:16 +09:00
enhance(admin): allow regenerating access tokens for bot accounts (#40109)
Bot accounts cannot sign in, so admins manage their access tokens, but the regenerate button was hidden for them. This adds an admin route to regenerate a bot's token. Token regeneration is now also recorded in the audit log. Fixes: https://github.com/go-gitea/gitea/issues/40074 Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
1 parent
08c5fcafd3
commit
365cb2bd5e
6 files changed
+41
-26
No files matched your search
@@ -388,6 +388,12 @@ func DeleteBotToken(ctx *context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func RegenerateBotToken(ctx *context.Context) {
|
||||
if u := getTargetBot(ctx); u != nil {
|
||||
user_setting.RegenerateAccessToken(ctx, u)
|
||||
}
|
||||
}
|
||||
|
||||
func editUserCommon(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.users.edit_account")
|
||||
ctx.Data["PageIsAdminUsers"] = true
|
||||
|
||||
Reference in new issue
Block a user