Welcome Guest, Not a member yet? Register   Sign In
Ion auth Noob Help
#1

Hi this is my first forum post, so please go easy.
This may a simple one but I just cannot get my head around it.
I have started a brand new Ci4 install and i'm trying to get ion auth to work. (I am a total Noob, I fumble around at the best of times, but I get there in the end)
I've managed to load the library, and when I run the following, it I get logged in.. perfect.
Code:
$identity = '[email protected]';
$password = 'password';
$remember = FALSE; // remember the user
$this->ionAuth->login($identity, $password, $remember);

The next stage which if i'm not logged in it redirects..
Code:
if ( !$this->ionAuth->loggedIn() ) {    
            return redirect()->to('auth/login');         
 }

That works.. It shows the login screen. Great.. But thats where it all comes crumbling down.. 
Trying to login from that point just 303s it.. I basically in a loop of regret from that point on..
Its either something to go with routes, or validation.. tbh I have no idea.

I'd be grateful if one of you fine wizards could help me problem solve this issue.

Cheers
Reply
#2

[quote pid="396999" dateline="1654920140"]
So I have added this piece of code, and getting a "the action your requested is not allowed"

So I'm guessing its a CSRF thing?

Code:
<?= session()->getFlashdata('error') ?>

[/quote]
Reply
#3

Hmm So I have added the below code to the form, and it submits
<?= csrf_field() ?>
Maybe I need a had to sort out my CSRF stuff.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB