Is there a notification event for when a protected...
# help-with-umbraco
m
I have a
free trial
member group that needs to expire after 14days, it currently checks for that on login and removes the member group if required, but with a perpetual auth cookie keeping the member signed they can maintain access. I was hoping for an event hook for accessing a protected page, so I can also do the check then, rather than on every page visit?
s
Probably better to run a background project and check the age of the member, if created >14 days ago, remove the role. There's this Hangfire package 😇 that can help you create scheduled tasks. https://marketplace.umbraco.com/package/cultiv.hangfire
m
yeah had thought of that (or even just the core
RecurringHostedService
), but event driven pattern at point of access would be better 🙂 Another thought was to replace IPublicAccessService with my own concrete implementation and extend
IsProtected
? would that cover it?
Actually wrong service.. meant
IPublicAccessChecker
and
HasMemberAccessToContentAsync
s
Could work too yeah!