refactor: require password verification
chore: styling work
This commit is contained in:
parent
7977fe9ea7
commit
86fa2b6d4b
16 changed files with 348 additions and 88 deletions
|
|
@ -119,6 +119,18 @@ export async function get_new_user(client: API_CLIENT, user_info?: Record<string
|
|||
new_user_request_json.password = `${Math.round(Math.random() * 10)} - ${random_username()} ! ${random_username()}`;
|
||||
}
|
||||
|
||||
if (
|
||||
!((typeof new_user_request_json.password_verification === 'string' && new_user_request_json.password_verification.length) ||
|
||||
(typeof new_user_request_json.password_verification_hash === 'string' && new_user_request_json.password_verification_hash.length))
|
||||
) {
|
||||
if ( typeof new_user_request_json.password === 'string' ) {
|
||||
new_user_request_json.password_verification = new_user_request_json.password;
|
||||
}
|
||||
else if ( typeof new_user_request_json.password_hash === 'string' ) {
|
||||
new_user_request_json.password_verification_hash = new_user_request_json.password_hash;
|
||||
}
|
||||
}
|
||||
|
||||
if (inviting_user_info) {
|
||||
const invite_code = await client.fetch(`/users/${inviting_user_info.user?.id}/invites`, {
|
||||
method: 'POST',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue