I have a number of authentication components that extend the BaseAuthenticate class. These are setup in the AppController in the normal way.
Is it possible for an authentication component to alter the AuthComponent’s loginRedirect variable?
To clarify the situation, one of my authentication components looks at a certain subset of users. It checks to see if the credentials are valid before checking to see if that person has any outstanding invoices. Depending on the outstanding value, I’d like to redirect the user to a given page or block them out altogether.
Thanks
A big thanks to @jerermyharris for pushing me in the right direction. Here goes with what I ended up doing.
1. Extended the AuthComponent
2. Add this the AppController components
Add this bit around whatever other definitions you have for your AuthComponent.
3. Return a redirect from your authentication component
So now if you want to redirect based on the user you can just add it in, if you don’t then cake will obey the directives you set up in AppController.
Wow, that seems like I’ve had to do loads extra, but it’s the right thing to do.