jgomez90
10 months ago

Require login for certain views?

Posted 10 months ago by jgomez90

Hi there,

I am building a small cms like application as a personal project and I'm wondering how can I get certain views to be 'authenicated' or password protected? For example, I ran the auth command and I have the dashboard routing to '/admin'.

I want to create a view with a form to post events so that route is /admin/events

If I was to hit that view directly with incognito mode it'll still load so I want it where if I someone was to access it by random it'll redirect them to the /login url to login. I do have plans for an events section as well. Let me know if there's more clarification needed.

Please sign in or create an account to participate in this conversation.