Add Member Login/Logout notifications #13081
Replies: 2 comments
-
Would be great to add these for Users too, for all the above use cases. |
Beta Was this translation helpful? Give feedback.
-
Sounds like a good idea to me. Implementation wise, the challenge is to make it in a non-breaking way, that is most likely sub-optimal. I think the best way to archive it, is to directly make the overrides in I think we can follow the same pattern for logouts, but that is currently not handled for users either. Please note that we need to handle external logins too. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Origin
In the CodeCabin chat the following question was asked by @MMasey "Does anyone know of any Umbraco packages which track member logins? and include this info in the backoffice?"
After a bit of investigation, it seems like there currently aren't any member login/logout notifications available.
Possible solution
As far as I can see, the best place to do this would be in the UmbracoSignInManager in HandleSignIn() as indicated by the comment at the top of that function 😄
An other option would be to implement PasswordSignInAsync(), SignInAsync() and SignOutAsync() on MemberSignInManager that wraps its base(UmbracoSignInManager) method with a notification based on the result before passing the result along. But then we should maybe also do this for the BackOfficeSignInManager and we have to write the if/else-if flow again to know which notification to send based on the MC base result...
Maybe we should also include the type of user in the logs, as it was unclear before diving into this code that Member logins are actually logged.
Possible use cases
Resolution
I wouldn't mind implementing this, but would love to have an OK from HQ first and what route they prefer I should take. Any input is greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions