When adding a user through the basic onboarding flow they get a temporary password, but we didn't set force password reset, meaning the user wouldn't necessarily have to change the temp password.
This commit is contained in:
parent
23071993c6
commit
f18a28f0c8
|
@ -16,7 +16,13 @@
|
||||||
admin = false
|
admin = false
|
||||||
|
|
||||||
async function createUser() {
|
async function createUser() {
|
||||||
const res = await users.create({ email: $email, password, builder, admin })
|
const res = await users.create({
|
||||||
|
email: $email,
|
||||||
|
password,
|
||||||
|
builder,
|
||||||
|
admin,
|
||||||
|
forceResetPassword: true,
|
||||||
|
})
|
||||||
if (res.status) {
|
if (res.status) {
|
||||||
notifications.error(res.message)
|
notifications.error(res.message)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -35,12 +35,21 @@ export function createUsersStore() {
|
||||||
return await response.json()
|
return await response.json()
|
||||||
}
|
}
|
||||||
|
|
||||||
async function create({ email, password, admin, builder }) {
|
async function create({
|
||||||
|
email,
|
||||||
|
password,
|
||||||
|
admin,
|
||||||
|
builder,
|
||||||
|
forceResetPassword,
|
||||||
|
}) {
|
||||||
const body = {
|
const body = {
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
roles: {},
|
roles: {},
|
||||||
}
|
}
|
||||||
|
if (forceResetPassword) {
|
||||||
|
body.forceResetPassword = forceResetPassword
|
||||||
|
}
|
||||||
if (builder) {
|
if (builder) {
|
||||||
body.builder = { global: true }
|
body.builder = { global: true }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue