onboarding page
This commit is contained in:
@@ -15,6 +15,7 @@ export interface User {
|
||||
role: UserRole;
|
||||
created_at: number;
|
||||
last_login: number | null;
|
||||
onboarding_completed_at: number | null;
|
||||
created_by: string | null;
|
||||
must_change_password: number;
|
||||
client_scope: ClientAccessScope;
|
||||
@@ -864,6 +865,15 @@ export function updateLastLogin(userId: number): void {
|
||||
);
|
||||
}
|
||||
|
||||
export function completeUserOnboarding(userId: number): boolean {
|
||||
const result = db
|
||||
.prepare(
|
||||
"UPDATE users SET onboarding_completed_at = ? WHERE id = ? AND onboarding_completed_at IS NULL",
|
||||
)
|
||||
.run(Date.now(), userId);
|
||||
return Number(result.changes) > 0;
|
||||
}
|
||||
|
||||
let _dummyHashPromise: Promise<string> | null = null;
|
||||
function getDummyPasswordHash(): Promise<string> {
|
||||
if (!_dummyHashPromise) {
|
||||
|
||||
Reference in New Issue
Block a user