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

Fix infinite redirect loop for user without organization and that is not superuser, nor partner #3808

Merged
merged 31 commits into from
Nov 24, 2023

Conversation

lokisk1155
Copy link
Collaborator

@lokisk1155 lokisk1155 commented Jul 31, 2023

Description

This PR resolves an issue with an infinite redirect loop that occurs for users who do not have an organization assigned and are not superusers or partners. After the change, the sign-in form responds with a 404 page instead of the infinite loop.

Such a case is not expected to exist in the wild, so it wasn't a serious problem. If such a case occurs, there will be needed some intervention anyway.

Slack ref: https://rubyforgood.slack.com/archives/C6WLZL0DD/p1684611196815299

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Steps:

  1. create a user without organization who is not superuser or partner:
user = User.create(email: '[email protected]', password: 'password!')
user.add_role(:org_user)
  1. sign in as this user
  2. 👉 you're redirected to a 404 page instead of an infinite redirect loop.

@lokisk1155
Copy link
Collaborator Author

Specs are passing locally... failing in workflow... weird ill figure it out

@lokisk1155 lokisk1155 changed the title fix infinite redirect loop for user without organization and that is not superuser, nor partner [WIP] fix infinite redirect loop for user without organization and that is not superuser, nor partner Jul 31, 2023
public/403.html Outdated
<!DOCTYPE html>
<html>
<head>
<title>The page you were looking for doesn't exist (404)</title>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Smallllll change, but this title doesn't match the body.

@lokisk1155 lokisk1155 requested a review from awwaiid August 6, 2023 15:51
@lokisk1155
Copy link
Collaborator Author

Sorry I missed that you re-reviewed; hoping tests pass now

@lokisk1155
Copy link
Collaborator Author

@awwaiid I really don't want to talk about why it took so long to get passing specs... but it's good to go

@lokisk1155 lokisk1155 changed the title [WIP] fix infinite redirect loop for user without organization and that is not superuser, nor partner Fix infinite redirect loop for user without organization and that is not superuser, nor partner Aug 6, 2023
public/403.html Outdated Show resolved Hide resolved
@lokisk1155
Copy link
Collaborator Author

@awwaiid @dorner This title fix ok? Sorry for the super long delay

Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

Nice!

@dorner dorner merged commit 68271ba into rubyforgood:main Nov 24, 2023
11 checks passed
Copy link
Contributor

@lokisk1155: Your PR Fix infinite redirect loop for user without organization and that is not superuser, nor partner is part of today's Human Essentials production release: 2023.11.26.
Thank you very much for your contribution!

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.

4 participants