How to subscribe to backend login event (if existing, else alternative solution)
Hi,
I checked the Overview of all events and I don't see any event such as AfterLogin or similar.
I found another thread in this forum where somebody suggests how to proceed, but without giving any code I'm not able to reproduce the given solution.
Can somebody help?
As it seems to me that no "AfterLogin" event exists, what I think I'll do is to create a session containing the loggedin username and run a method called "userRedirect". There will be a check to see if the session is existing. If yes, do nothing (as the user already logged in and was already redirected), if not, create the session and call userRedirect as stated above.
I'd like this to work only in the backend. No idea how to proceed and I would be really happy if somebody can give me precise instructions (where to create the class, a code snippet...).
That's a good and helpful reply. By the way, I would put this answer/information also somewhere in the wiki, maybe related to the events. Can be helpful for other people too (ok they can find it in the forum but still, the wiki is more important on my opinion, and, if well mantained, always a good reference to all developers...)
How to subscribe to backend login event (if existing, else alternative solution)
Hi,
I checked the Overview of all events and I don't see any event such as AfterLogin or similar.
I found another thread in this forum where somebody suggests how to proceed, but without giving any code I'm not able to reproduce the given solution.
Can somebody help?
As it seems to me that no "AfterLogin" event exists, what I think I'll do is to create a session containing the loggedin username and run a method called "userRedirect". There will be a check to see if the session is existing. If yes, do nothing (as the user already logged in and was already redirected), if not, create the session and call userRedirect as stated above.
I'd like this to work only in the backend. No idea how to proceed and I would be really happy if somebody can give me precise instructions (where to create the class, a code snippet...).
Thanks and cheers
Hi firepol,
The other thread mentions about overridding Umbraco's own membership provider with a custom one, then you can hook into various calls from there.
Quick code snippet would be...
You can either drop this in your App_Code, or compile it to your own assembly.
Then replace the current Umbraco membership provider...
Now whenever someone logs into the back-office, it would call your code.
Cheers, Lee.
Hi Lee,
Can you please let me know if you have the code snippet to the same for Umbraco 14?
Thanks in adv.
Thanks Lee, you rock!
That's a good and helpful reply. By the way, I would put this answer/information also somewhere in the wiki, maybe related to the events. Can be helpful for other people too (ok they can find it in the forum but still, the wiki is more important on my opinion, and, if well mantained, always a good reference to all developers...)
Cheers
Hei Lee, if you have time, it would be cool if you could have a look also at this question related to this thread.
Actually I thought it would be easy/peasy but as Murphy is always there, it wasn't ;)
Thanks and cheers
--firepol
is working on a reply...