Content-Length: 291655 | pFad | http://github.com/Sefaria/Sefaria-Project/pull/2425

58 Logout from sheets module will redirect to sheets homepage by YishaiGlasner · Pull Request #2425 · Sefaria/Sefaria-Project · GitHub
Skip to content

Logout from sheets module will redirect to sheets homepage #2425

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

Merged
merged 3 commits into from
May 11, 2025

Conversation

YishaiGlasner
Copy link
Contributor

Description

Previuously we've used the Django CustomLogoutView and defined LOGOUT_REDIRECT_URL.
Now we'll override Django's get_next_page, and get the next page from the next param of the request.

Code Changes

sefaria.js - add function getLogoutUrl that defines once the logout url with the next param according to the module.
Header.jsx - use getLogoutUrl anywhere rather than a magic string.
sefaria/views.py - override CustomLogoutView.get_next_page for getting next from the url params if exists, rather fall to Django's get_next_page.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the logout functionality so that users logging out from the sheets module are redirected to the sheets homepage, while other modules continue to use the existing logic. Key changes include:

  • Adding a new getLogoutUrl function in sefaria.js that builds the logout URL with an appropriate next parameter.
  • Replacing all hard-coded '/logout' links in Header.jsx (and related components) with calls to Sefaria.getLogoutUrl().
  • Overriding CustomLogoutView.get_next_page in sefaria/views.py to extract the next parameter from the URL.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
static/js/sefaria/sefaria.js Adds a centralized getLogoutUrl function that builds a logout URL with a next param based on module.
static/js/Header.jsx Updates logout links to use Sefaria.getLogoutUrl() instead of a hard-coded string.
sefaria/views.py Overrides CustomLogoutView.get_next_page to prioritize the next param from the URL if provided.
Comments suppressed due to low confidence (2)

static/js/sefaria/sefaria.js:3503

  • [nitpick] Consider renaming the variable 'next' within this function to a more descriptive name, such as 'redirectModule', to improve code clarity.
getLogoutUrl: () => {

sefaria/views.py:87

  • Ensure that the 'next' parameter obtained from the request is validated or sanitized to prevent potential open redirects if such checks are not already enforced elsewhere.
def get_next_page(self):

@yitzhakc yitzhakc self-requested a review May 6, 2025 10:15
@yitzhakc yitzhakc merged commit e2ef6d4 into modularization-main May 11, 2025
15 of 17 checks passed
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.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Sefaria/Sefaria-Project/pull/2425

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy