Fix sign-in links and legacy JWT after Periscope rebrand.

/login 404ed from marketing CTAs; redirect to /sign-in and accept pinscope-local tokens plus dual-host CORS so login works on both hostnames.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-13 20:12:53 +02:00
co-authored by Cursor
parent 8d2b85600f
commit dc364f5926
8 changed files with 51 additions and 23 deletions
+14 -11
View File
@@ -32,14 +32,17 @@ def decode_token(token: str) -> dict[str, Any] | None:
secret = settings.auth_jwt_secret
if not secret:
return None
try:
return jwt.decode(
token,
secret,
algorithms=[ALGORITHM],
issuer="periscope-local",
options={"verify_aud": False},
leeway=10,
)
except jwt.PyJWTError:
return None
# Accept pre-rebrand issuer so existing sessions keep working.
for issuer in ("periscope-local", "pinscope-local"):
try:
return jwt.decode(
token,
secret,
algorithms=[ALGORITHM],
issuer=issuer,
options={"verify_aud": False},
leeway=10,
)
except jwt.PyJWTError:
continue
return None