Fix TypeScript errors for Netlify Identity integration

- Add proper TypeScript types for Netlify Identity in env.d.ts
- Define NetlifyUser and NetlifyIdentity interfaces
- Fix ESLint errors by removing 'any' types
- Add optional chaining for safe access
- Apply code formatting with Prettier

All TypeScript, ESLint, and Prettier checks now pass successfully.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Buğra
2025-07-10 01:01:12 +03:00
parent 733be12298
commit a9dce67054
6 changed files with 75 additions and 13 deletions
+5 -5
View File
@@ -35,7 +35,7 @@ const { language, textDirection } = I18N;
<Metadata {...metadata} />
<SiteVerification />
<Analytics />
<!-- Netlify Identity for Decap CMS -->
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
@@ -47,14 +47,14 @@ const { language, textDirection } = I18N;
<slot />
<BasicScripts />
<!-- Netlify Identity initialization -->
<script>
if (window.netlifyIdentity) {
window.netlifyIdentity.on("init", user => {
window.netlifyIdentity.on('init', (user) => {
if (!user) {
window.netlifyIdentity.on("login", () => {
document.location.href = "/admin/";
window.netlifyIdentity?.on('login', () => {
document.location.href = '/admin/';
});
}
});