Assistance setting up Identity - using open modal for login screen

Since this question falls outside of support. anyone in the community can assist on how to use the open modal? I can’t seem to get it to work. I have a page that I configured the identity on and I want that page to automatically open up the login/sing in form if the user is not already logged in (that way content of the form is not accessible). see attached image

Thanks

Have you looked at the netlify-identity-widget repository on GitHub?

Under the usage section you’ll find there is netlifyIdentity.open() which opens the modal. So you could add an eventListener to an element on the page (or the document itself) to call that function.

About this… That’s not a fail-safe. It is easy to open developer tools and delete the modal node from the page, leaving anything behind it accessible.

If you want to restrict who can submit data on the form, you would want to (also) check the user is logged in when the submit button it pressed.

2 Likes

Thank you Sir! working on the suggestion now!

Perfect I got it to work! Thanks @jasiqli

1 Like

glad you found your solution! :netliheart: