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

Use session to manage redirect location #7

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

dylanpivo
Copy link
Contributor

  • Added a context_processor to the flask app to keep track of the "active_page_url" using the session.
  • When returning from identity service, use the "active_page_url" session variable to redirect back to the active page.

odp/ui/client.py Outdated
@@ -190,7 +190,9 @@ def _logged_in(self):

login_user(localuser)

return redirect(url_for('home.index'))
active_page = session['active_page_url'] if 'active_page_url' in session else url_for('home.index')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RHS can be shortened to session.get('active_page_url') or url_for('home.index')

@marksparkza
Copy link
Member

Thanks for this - a very useful addition to the library.

I've just added one suggestion to make it slightly more succinct.

@marksparkza marksparkza merged commit 563fb0c into SAEON:main Jul 26, 2024
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

Successfully merging this pull request may close these issues.

2 participants