Skip to content

Commit

Permalink
feat: added logic for https config (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: Tipu_Singh <[email protected]>
  • Loading branch information
tipusinghaw authored Oct 25, 2024
1 parent 92db084 commit 4bef475
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import logger from "./logger";
import { DEFAULT_EXPECTED_ORIGINS, DEFAULT_RP_ID, RP_NAME, TIMEOUT } from "./constants";
import csrf from 'lusca';
import rateLimit from 'express-rate-limit';
dotenv.config();

type AuthenticatorDevice = {
credentialPublicKey: string;
Expand Down Expand Up @@ -137,7 +138,6 @@ app.get("/generate-registration-options", async (req, res) => {
.json({ error: "Failed to generate registration options" });
}
});

app.post('/verify-registration', async (req, res) => {
logger.info('verify-registration-called');

Expand Down Expand Up @@ -265,7 +265,7 @@ app.post("/verify-authentication", async (req, res) => {
res.send({ verified });
});

if (ENABLE_HTTPS) {
if (ENABLE_HTTPS === 'true') {
const host = "0.0.0.0";
const port = 443;
const expectedOrigin = `https://${rpID}`;
Expand Down

0 comments on commit 4bef475

Please sign in to comment.