feat: add /bookshelf route and update redirects
- Add /bookshelf route as default page for logged-in users - Update login and register handlers to redirect to /bookshelf - Update homepage to auto-redirect to /bookshelf when logged in - Preserve /dashboard route for backward compatibility - Update test redirects to use /bookshelf Changes: - main.go: Add /bookshelf protected route - auth.go: Change login/register redirects from /api/dashboard to /bookshelf (2 locations) - edge_cases_test.go: Update test redirect to /bookshelf - Maintains backward compatibility with existing /dashboard route This makes the beautiful bookshelf the default landing page for all authenticated users while keeping the old dashboard accessible.
This commit is contained in:
@@ -256,7 +256,7 @@ localStorage.setItem('token', '%s');
|
||||
localStorage.setItem('refreshToken', '%s');
|
||||
localStorage.setItem('user', JSON.stringify(%s));
|
||||
document.cookie = 'token=%s; path=/; max-age=3600';
|
||||
window.location.href = '/api/dashboard';
|
||||
window.location.href = '/bookshelf';
|
||||
</script>`, accessToken, refreshToken, fmt.Sprintf(`{"id":"%s","email":"%s","username":"%s"}`, uuid.UUID(user.ID.Bytes).String(), user.Email, user.Username), accessToken)
|
||||
return c.HTML(http.StatusCreated, html)
|
||||
}
|
||||
@@ -412,7 +412,7 @@ localStorage.setItem('token', '%s');
|
||||
localStorage.setItem('refreshToken', '%s');
|
||||
localStorage.setItem('user', JSON.stringify(%s));
|
||||
document.cookie = 'token=%s; path=/; max-age=3600';
|
||||
window.location.href = '/api/dashboard';
|
||||
window.location.href = '/bookshelf';
|
||||
</script>`, accessToken, refreshToken, fmt.Sprintf(`{"id":"%s","email":"%s","username":"%s","first_name":"%s","last_name":"%s"}`, uuid.UUID(user.ID.Bytes).String(), user.Email, user.Username, user.FirstName.String, user.LastName.String), accessToken)
|
||||
return c.HTML(http.StatusOK, html)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user