fix(ssologin): set default role for SSO user creation

pull/9305/head
sakkyoi 2025-09-03 00:10:06 +08:00
parent 51b84ce59e
commit ec7a911ebc
No known key found for this signature in database
GPG Key ID: FC3D07D7D252B698
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"encoding/base64"
"errors"
"fmt"
"github.com/alist-org/alist/v3/internal/op"
"net/http"
"net/url"
"path"
@ -154,7 +155,7 @@ func autoRegister(username, userID string, err error) (*model.User, error) {
Password: random.String(16),
Permission: int32(setting.GetInt(conf.SSODefaultPermission, 0)),
BasePath: setting.GetStr(conf.SSODefaultDir),
Role: nil,
Role: model.Roles{op.GetDefaultRoleID()},
Disabled: false,
SsoID: userID,
}