Feat/onboarding admin (#3486)

* WIP

* API and step done fallback

* Finishing up tweaks

* Inline comment

* Translations

* Update apps/web/pages/api/auth/setup.ts

Co-authored-by: Omar López <[email protected]>

* Update apps/web/pages/api/auth/setup.ts

Co-authored-by: Omar López <[email protected]>

* Update apps/web/pages/api/auth/setup.ts

Co-authored-by: Omar López <[email protected]>

* Update apps/web/pages/api/auth/setup.ts

Co-authored-by: Omar López <[email protected]>

* Linting fixes

* Update apps/web/pages/auth/setup.tsx

Co-authored-by: Omar López <[email protected]>

* Linting fix

* Moving to v2

* Translations

Co-authored-by: Leo Giovanetti <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2022-07-27 17:28:21 -06:00
1 parent b3bd8c1a58
commit bfa70dcc83
9 files changed
+436 -4

No files matched your search

+16
View File
@@ -18,3 +18,19 @@ export async function getSession(options: GetSessionParams): Promise<Session | n
// that these are equal are ensured in `[...nextauth]`'s callback
return session as Session | null;
}
export function isPasswordValid(password: string) {
let cap = false,
low = false,
num = false,
min = false;
if (password.length > 6) min = true;
for (let i = 0; i < password.length; i++) {
if (!isNaN(parseInt(password[i]))) num = true;
else {
if (password[i] === password[i].toUpperCase()) cap = true;
if (password[i] === password[i].toLowerCase()) low = true;
}
}
return cap && low && num && min;
}