no message
This commit is contained in:
parent
a48656bdc9
commit
7a0ab2271d
1 changed files with 9 additions and 6 deletions
|
|
@ -490,15 +490,18 @@ export async function getUserRoles(userId: string) {
|
||||||
* @returns true if success, false otherwise.
|
* @returns true if success, false otherwise.
|
||||||
*/
|
*/
|
||||||
export async function addUserRoles(userId: string, roles: { id: string; name: string }[]) {
|
export async function addUserRoles(userId: string, roles: { id: string; name: string }[]) {
|
||||||
const res = await fetch(`${KC_URL}/admin/realms/${KC_REALMS}/users/${userId}`, {
|
const res = await fetch(
|
||||||
// prettier-ignore
|
`${KC_URL}/admin/realms/${KC_REALMS}/users/${userId}/role-mappings/realm`,
|
||||||
headers: {
|
{
|
||||||
|
// prettier-ignore
|
||||||
|
headers: {
|
||||||
"authorization": `Bearer ${await getToken()}`,
|
"authorization": `Bearer ${await getToken()}`,
|
||||||
"content-type": `application/json`,
|
"content-type": `application/json`,
|
||||||
},
|
},
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(roles),
|
body: JSON.stringify(roles),
|
||||||
}).catch((e) => console.log(e));
|
},
|
||||||
|
).catch((e) => console.log(e));
|
||||||
|
|
||||||
if (!res) return false;
|
if (!res) return false;
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue