feat: keycloak service add other params
For additional paramater (Take a look at keycloak admin RestAPI manual)
This commit is contained in:
parent
21c4901e4f
commit
ed75115651
1 changed files with 2 additions and 1 deletions
|
|
@ -65,7 +65,7 @@ export async function getToken() {
|
|||
*
|
||||
* @returns user uuid or true if success, false otherwise.
|
||||
*/
|
||||
export async function createUser(username: string, password: string) {
|
||||
export async function createUser(username: string, password: string, opts?: Record<string, any>) {
|
||||
const res = await fetch(`${KC_URL}/admin/realms/${KC_REALM}/users`, {
|
||||
// prettier-ignore
|
||||
headers: {
|
||||
|
|
@ -77,6 +77,7 @@ export async function createUser(username: string, password: string) {
|
|||
enabled: true,
|
||||
credentials: [{ type: "password", value: password }],
|
||||
username,
|
||||
...opts,
|
||||
}),
|
||||
}).catch((e) => console.log("Keycloak Error: ", e));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue