Add new CLI flags to set name and scopes when creating a user with access token (#34080)

Resolves #33474.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 55a69ae4c63ee8551eadb161cb901ba0a2a2e194)
This commit is contained in:
Kemal Zebari 2025-04-02 07:00:54 -07:00 committed by Michael Jerger
parent 02d9c7cd27
commit f7b19964a7
4 changed files with 50 additions and 12 deletions

View file

@ -49,6 +49,9 @@ func ApplicationsPost(ctx *context.Context) {
ctx.ServerError("GetScope", err)
return
}
if !scope.HasPermissionScope() {
ctx.Flash.Error(ctx.Tr("settings.at_least_one_permission"), true)
}
t := &auth_model.AccessToken{
UID: ctx.Doer.ID,
Name: form.Name,