1
0
Fork 0
mirror of synced 2024-06-28 11:00:55 +12:00

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:
mike12345567 2021-10-21 17:25:29 +01:00
parent 4794a5374e
commit 47ebc393c7
2 changed files with 17 additions and 2 deletions

View file

@ -16,7 +16,13 @@
admin = false
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) {
notifications.error(res.message)
} else {

View file

@ -35,12 +35,21 @@ export function createUsersStore() {
return await response.json()
}
async function create({ email, password, admin, builder }) {
async function create({
email,
password,
admin,
builder,
forceResetPassword,
}) {
const body = {
email,
password,
roles: {},
}
if (forceResetPassword) {
body.forceResetPassword = forceResetPassword
}
if (builder) {
body.builder = { global: true }
}