Fix Netlify Identity confirmation email authentication flow

- Create dedicated /auth page to handle confirmation, recovery, and invite tokens
- Add proper redirects in _redirects and netlify.toml for token handling
- Update main layout to automatically redirect authentication tokens to auth page
- Add Turkish authentication interface with loading states and error handling
- Provide fallback redirect mechanisms for different token types
- Update documentation with current setup status and fixes

This resolves the issue where confirmation emails linked to hash URLs that didn't work.
Now users will be properly guided through the authentication process.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Buğra
2025-07-10 03:18:53 +03:00
parent db63a8f4d8
commit f041165e9b
5 changed files with 204 additions and 10 deletions
+12
View File
@@ -52,6 +52,18 @@ const { language, textDirection } = I18N;
<script>
if (window.netlifyIdentity) {
window.netlifyIdentity.on('init', (user) => {
// Check if we're on a page that needs authentication handling
const currentPath = window.location.pathname;
const hasAuthTokens = window.location.hash.includes('confirmation_token') ||
window.location.hash.includes('recovery_token') ||
window.location.hash.includes('invite_token');
// If we have auth tokens and we're not on the auth page, redirect to auth page
if (hasAuthTokens && currentPath !== '/auth') {
window.location.href = '/auth' + window.location.hash;
return;
}
if (!user) {
window.netlifyIdentity?.on('login', () => {
document.location.href = '/admin/';