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:
@@ -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/';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user