smathy

smathy

Right, I mean there’s nothing wrong with your code, but obviously that’s why your / is logged in. Your original post suggested you had just run the generator and things were broken.

So now the problem you have is really that you’re never logged in for any route (other than the ones you’ve manually logged in with your own custom code) :man_facepalming:

So totally different diagnosis. You’d have to start looking through your AdminAuth module at your fetch_current_admin, make sure that’s the plug being used in your pipeline in your routes, then taking a look at your ensure_authenticated handler, etc..

0
Post #11
karlosmid

karlosmid

Hi!
session can not be updated in live view.
You need to submit live view login form to phoenix controller that will do the authentication of user credentials.
In controller you store user_id in session. In on_mount callback you read user_id from that session.

2
Post #12
— All posts loaded —