Fase A identity on PCB HEAD: operator fence, keep BOM/SPOF/EMI.
Replace Faradworks Inc. TOS/privacy/contact/metadata with Michele Bigi. Dual-read pinscope_* keys; write periscope_* only. AGPL LICENSE and GitHub fork parent unchanged. validate.py not edited.
This commit is contained in:
@@ -8,6 +8,7 @@ from typing import Any
|
||||
import jwt
|
||||
|
||||
from backend.config import settings
|
||||
from backend.pinscope_compat import JWT_ISSUER, READ_JWT_ISSUERS
|
||||
|
||||
ALGORITHM = "HS256"
|
||||
TOKEN_TTL_DAYS = 30
|
||||
@@ -21,7 +22,7 @@ def issue_token(user_id: str, email: str) -> str:
|
||||
payload = {
|
||||
"sub": user_id,
|
||||
"email": email,
|
||||
"iss": "periscope-local",
|
||||
"iss": JWT_ISSUER,
|
||||
"iat": now,
|
||||
"exp": now + timedelta(days=TOKEN_TTL_DAYS),
|
||||
}
|
||||
@@ -32,8 +33,8 @@ def decode_token(token: str) -> dict[str, Any] | None:
|
||||
secret = settings.auth_jwt_secret
|
||||
if not secret:
|
||||
return None
|
||||
# Accept pre-rebrand issuer so existing sessions keep working.
|
||||
for issuer in ("periscope-local", "pinscope-local"):
|
||||
# Dual-read PinScope issuer; never write it (see pinscope_compat).
|
||||
for issuer in READ_JWT_ISSUERS:
|
||||
try:
|
||||
return jwt.decode(
|
||||
token,
|
||||
|
||||
Reference in New Issue
Block a user