mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-05 02:24:59 +02:00
make config class and separate migrations script
This commit is contained in:
parent
b199595100
commit
9732098799
45 changed files with 163 additions and 156 deletions
|
@ -60,7 +60,7 @@ export async function signup(
|
|||
const passwordHash = await hashPassword(password);
|
||||
const userId = generateId(15);
|
||||
|
||||
if (config.flags?.disable_signup_without_invite) {
|
||||
if (config.getRawConfig().flags?.disable_signup_without_invite) {
|
||||
if (!inviteToken || !inviteId) {
|
||||
return next(
|
||||
createHttpError(
|
||||
|
@ -102,7 +102,7 @@ export async function signup(
|
|||
.where(eq(users.email, email));
|
||||
|
||||
if (existing && existing.length > 0) {
|
||||
if (!config.flags?.require_email_verification) {
|
||||
if (!config.getRawConfig().flags?.require_email_verification) {
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.BAD_REQUEST,
|
||||
|
@ -163,7 +163,7 @@ export async function signup(
|
|||
const cookie = serializeSessionCookie(token);
|
||||
res.appendHeader("Set-Cookie", cookie);
|
||||
|
||||
if (config.flags?.require_email_verification) {
|
||||
if (config.getRawConfig().flags?.require_email_verification) {
|
||||
sendEmailVerificationCode(email, userId);
|
||||
|
||||
return response<SignUpResponse>(res, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue