Access Resource with a PIN

Any suggestions on how to proceed when a Resource is accessed, requesting a Modal or Page requesting a PIN (from users) as a way to access the resource?
8 Replies
Aivirth
Aivirth7d ago
I would try to use a middleware, probably setup a cookie too on pin successful so it doesn't ask for it every page reload or switch
Dennis Koch
Dennis Koch7d ago
As Aivirth suggested: You can use a $routeMiddleware on the page, redirecting to a PIN page and redirecting back on success. A modal on the page would be too late. You could modify the EditAction/ViewAction to add this modal, if the target page is marked as "protected" but that's a bit more complex
Povilas Korop
Povilas Korop7d ago
@! Skull™👻 I recently shot a video answering a similar question on Discord but with paywall instead of PIN, but the logic could be the same: https://www.youtube.com/watch?v=Yr_m7ku3024
Povilas Korop
Povilas Korop7d ago
here's the original question
No description
! Skull™👻
! Skull™👻OP7d ago
Thanks for the help, it's working now
No description
! Skull™👻
! Skull™👻OP7d ago
With a config routes
No description
Dennis Koch
Dennis Koch6d ago
If it's just a modal, users could remove it via DevTools.
! Skull™👻
! Skull™👻OP6d ago
Yes, I thought about that too. But I inserted hidden fields with a function that checks the cookie. Even recalling the modal via inspect element will have the second layer of verification directly in the resources. In the short term, this is sufficient, but in the long term, with more and more future features, this could become too cluttered.

Did you find this page helpful?