@seamless-auth/express 0.1.1 → 0.1.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +7 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -369,7 +369,11 @@ function createSeamlessAuthServer(opts) {
369
369
  };
370
370
  const proxyWithIdentity = (path, identity, method = "POST") => async (req, res) => {
371
371
  if (!req.cookiePayload?.sub) {
372
- res.status(401).json({ error: "unauthenticated" });
372
+ console.warn(
373
+ "[SEAMLESS-AUTH-EXPRESS] - (proxyWithIdentity) - Missing expected cookie payload/sub.",
374
+ req.cookiePayload
375
+ );
376
+ res.status(401).json({ error: "Unauthenticated request" });
373
377
  return;
374
378
  }
375
379
  if (identity === "access" && !req.cookies[resolvedOpts.accessCookieName]) {
@@ -434,11 +438,11 @@ function createSeamlessAuthServer(opts) {
434
438
  );
435
439
  r.get(
436
440
  "/otp/generate-phone-otp",
437
- proxyWithIdentity("otp/generate-phone-otp", "preAuth")
441
+ proxyWithIdentity("otp/generate-phone-otp", "preAuth", "GET")
438
442
  );
439
443
  r.get(
440
444
  "/otp/generate-email-otp",
441
- proxyWithIdentity("otp/generate-email-otp", "preAuth")
445
+ proxyWithIdentity("otp/generate-email-otp", "preAuth", "GET")
442
446
  );
443
447
  r.post("/login", (req, res) => login(req, res, resolvedOpts));
444
448
  r.post(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamless-auth/express",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-beta.1",
4
4
  "description": "Express adapter for Seamless Auth passwordless authentication",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -54,4 +54,4 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  }
57
- }
57
+ }