Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirecting to the originally requested URL after being redirected by a restricted route #44

Closed
xavi opened this issue Mar 4, 2013 · 1 comment

Comments

@xavi
Copy link
Contributor

xavi commented Mar 4, 2013

I was planning to use the restricted macro after reading about it in http://yogthos.net/blog/37 , but then I realized that it doesn't support a way to store the originally requested URL. For example, if a not logged-in user tries to access a page that requires to log in, then, after redirecting to the login page, and once the user is logged in, it's often desirable to redirect to the originally requested page.

I guess the rule function may be used to store this originally requested URL in the session, but it doesn't seem appropriate to me that the rule function has a side-effect like this.

Do you know of a better way to handle this?

@yogthos
Copy link
Contributor

yogthos commented Mar 4, 2013

I think the session is the right place for this. If you'd like to do it a more structured way I would recommend checking out friend, which supports this sort of thing.

The restricted macro in lib-noir is meant to provide basic access restriction, so I don't make assumptions about having a session available.

@yogthos yogthos closed this as completed May 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants