addRole User
This commit is contained in:
parent
ef4d34d333
commit
7af21b6fe2
1 changed files with 11 additions and 2 deletions
|
|
@ -79,6 +79,7 @@ export class KeycloakController extends Controller {
|
|||
firstName?: string;
|
||||
lastName?: string;
|
||||
email?: string;
|
||||
roles?: string[];
|
||||
},
|
||||
) {
|
||||
const userId = await createUser(body.username, body.password, {
|
||||
|
|
@ -128,7 +129,10 @@ export class KeycloakController extends Controller {
|
|||
// });
|
||||
|
||||
// io.getInstance()?.emit("FolderCreate", folderData);
|
||||
|
||||
const _roles = {
|
||||
role: body.roles || [],
|
||||
};
|
||||
const addRole = await this.addRole(userId, _roles);
|
||||
return userId;
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +146,8 @@ export class KeycloakController extends Controller {
|
|||
firstName?: string;
|
||||
lastName?: string;
|
||||
email?: string;
|
||||
attributes?: object
|
||||
attributes?: object;
|
||||
// roles?: string[];
|
||||
},
|
||||
) {
|
||||
// return await editUser(userId, body);
|
||||
|
|
@ -150,6 +155,10 @@ export class KeycloakController extends Controller {
|
|||
if (typeof chkUpdate !== "boolean") {
|
||||
throw new Error(chkUpdate.errorMessage);
|
||||
}
|
||||
// const _rolesUpdate = {
|
||||
// role: body.roles || [],
|
||||
// };
|
||||
// const addRole = await this.addRole(userId, _rolesUpdate);
|
||||
return chkUpdate
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue