fix: correct localStorage token name from 'token' to 'authToken'
Fixed authentication token inconsistency in subscription pages:
Issue:
- Subscription pages were using localStorage.getItem('token')
- Rest of the app uses localStorage.getItem('authToken')
- This caused users to be redirected to login when accessing subscription pages
Files Fixed:
- app/[locale]/subscription/page.tsx
* fetchUserData() function
* handleUpgrade() function
* handleManageSubscription() function
- app/[locale]/subscription/success/page.tsx
* SuccessContent component verification
- components/subscription/usage-display.tsx
* fetchUsageData() function
Result:
- Users can now access subscription pages when logged in
- Consistent authentication token naming across entire app
- No more unwanted redirects to login page
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -44,7 +44,7 @@ function SuccessContent() {
|
||||
// Give webhooks a moment to process, then verify the user's subscription
|
||||
const timer = setTimeout(async () => {
|
||||
try {
|
||||
const token = localStorage.getItem('token')
|
||||
const token = localStorage.getItem('authToken')
|
||||
if (!token) {
|
||||
router.push(`/${locale}/login`)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user