Skip to content

feat(auth): add signed app_meta cookie with role and onboarding status#10

Merged
Nirbhay21 merged 1 commit into
mainfrom
feature/meta-cookie-onboarding
Feb 20, 2026
Merged

feat(auth): add signed app_meta cookie with role and onboarding status#10
Nirbhay21 merged 1 commit into
mainfrom
feature/meta-cookie-onboarding

Conversation

@Nirbhay21
Copy link
Copy Markdown
Owner

Summary

This PR introduces a signed app_meta cookie to keep frontend state in sync with
user role and onboarding completion status. It also strengthens onboarding
validation logic and adds PATCH support in CORS configuration.

Scope

Auth

  • getMe now:
    • Fetches onboarding status
    • Sets signed app_meta cookie (role + onboarding complete flag)
    • Returns onboardingStatus in response

Onboarding

  • getOnboardingStatus updates signed meta cookie
  • completeOnboarding:
    • Accepts onboardingData, currentStep, onboardingType
    • Validates role consistency
    • Validates step range (1–3)
    • Updates meta cookie after completion
  • updateStatus now strictly enforces onboardingType === user role

Security / Validation

  • Added SECRET_KEY to env schema
  • Centralized parseUserRole helper
  • Prevents role spoofing during onboarding updates

Infrastructure

  • Enabled PATCH in CORS config

@Nirbhay21 Nirbhay21 merged commit 9340c33 into main Feb 20, 2026
1 check passed
@Nirbhay21 Nirbhay21 deleted the feature/meta-cookie-onboarding branch February 20, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant