mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-29 06:08:15 +02:00
allow using password to log in if security keys are available
This commit is contained in:
parent
9f2710185b
commit
053acef728
3 changed files with 22 additions and 31 deletions
|
@ -235,25 +235,16 @@ export const configSchema = z
|
||||||
dns: z
|
dns: z
|
||||||
.object({
|
.object({
|
||||||
nameservers: z
|
nameservers: z
|
||||||
.array(z.string().url())
|
.array(z.string().optional().optional())
|
||||||
.optional()
|
.optional()
|
||||||
.default([
|
.default(["ns1.fossorial.io", "ns2.fossorial.io"]),
|
||||||
"ns1.fossorial.io",
|
cname_extension: z.string().optional().default("fossorial.io")
|
||||||
"ns2.fossorial.io",
|
})
|
||||||
]),
|
|
||||||
cname_extension: z
|
|
||||||
.string()
|
|
||||||
.optional()
|
|
||||||
.default("fossorial.io"),
|
|
||||||
})
|
|
||||||
.optional()
|
.optional()
|
||||||
.default({
|
.default({
|
||||||
nameservers: [
|
nameservers: ["ns1.fossorial.io", "ns2.fossorial.io"],
|
||||||
"ns1.fossorial.io",
|
|
||||||
"ns2.fossorial.io",
|
|
||||||
],
|
|
||||||
cname_extension: "fossorial.io"
|
cname_extension: "fossorial.io"
|
||||||
}),
|
})
|
||||||
})
|
})
|
||||||
.refine(
|
.refine(
|
||||||
(data) => {
|
(data) => {
|
||||||
|
|
|
@ -106,21 +106,21 @@ export async function login(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if user has security keys registered
|
// // Check if user has security keys registered
|
||||||
const userSecurityKeys = await db
|
// const userSecurityKeys = await db
|
||||||
.select()
|
// .select()
|
||||||
.from(securityKeys)
|
// .from(securityKeys)
|
||||||
.where(eq(securityKeys.userId, existingUser.userId));
|
// .where(eq(securityKeys.userId, existingUser.userId));
|
||||||
|
//
|
||||||
if (userSecurityKeys.length > 0) {
|
// if (userSecurityKeys.length > 0) {
|
||||||
return response<LoginResponse>(res, {
|
// return response<LoginResponse>(res, {
|
||||||
data: { useSecurityKey: true },
|
// data: { useSecurityKey: true },
|
||||||
success: true,
|
// success: true,
|
||||||
error: false,
|
// error: false,
|
||||||
message: "Security key authentication required",
|
// message: "Security key authentication required",
|
||||||
status: HttpCode.OK
|
// status: HttpCode.OK
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (
|
if (
|
||||||
existingUser.twoFactorSetupRequested &&
|
existingUser.twoFactorSetupRequested &&
|
||||||
|
|
|
@ -229,7 +229,7 @@ export async function createOrgDomain(
|
||||||
|
|
||||||
// TODO: This needs to be cross region and not hardcoded
|
// TODO: This needs to be cross region and not hardcoded
|
||||||
if (type === "ns") {
|
if (type === "ns") {
|
||||||
nsRecords = config.getRawConfig().dns.nameservers;
|
nsRecords = config.getRawConfig().dns.nameservers as string[];
|
||||||
} else if (type === "cname") {
|
} else if (type === "cname") {
|
||||||
cnameRecords = [
|
cnameRecords = [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue