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

Redirect users to organisations index/show after sign in #87

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

CatalinVoineag
Copy link
Contributor

@CatalinVoineag CatalinVoineag commented Jan 8, 2024

Context

In claims we need to redirect our users to the organisations index page. Some users do have only one organisation(school) so for those users we will redirect them to the school show page, we do this via another redirect in the schools controller just to make sure a user with one school doesn't land on the organisation(school) index page.

This change also affects placements where we will always redirect the user after sign in to the organisations index page, allowing placements to add their logic in their controllers

Also I didn't want to add too much logic in the application controller.

Changes proposed in this pull request

Application controller
Scholl Controller

Guidance to review

Claims:

  • Sign in as a user with one organisation
  • You should be redirected to the org show page
  • Sign in as a multiple school user like Mary
  • Should be redirected to org index page

Placements:

  • Sign in as any user
  • You should be redirected to org index page

Screenshots

Peek.2024-01-08.13-07.mp4

@CatalinVoineag CatalinVoineag marked this pull request as ready for review January 8, 2024 13:08
@CatalinVoineag CatalinVoineag requested review from a team as code owners January 8, 2024 13:08
@CatalinVoineag CatalinVoineag changed the title Redirect users to organisations index after sign in Redirect users to organisations index/show after sign in Jan 8, 2024
@CatalinVoineag CatalinVoineag self-assigned this Jan 8, 2024
@CatalinVoineag
Copy link
Contributor Author

Copy link
Contributor

@Nitemaeric Nitemaeric left a comment

Choose a reason for hiding this comment

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

Looking good!

app/controllers/application_controller.rb Outdated Show resolved Hide resolved
app/controllers/claims/schools_controller.rb Outdated Show resolved Hide resolved
In claims we need to redirect our users to the organisations index page.
Some users do have only one organisation(school) so for those users we
will redirect them to the school show page, we do this via another
redirect in the schools controller just to make sure a user with one
school doesn't land on the organisation(school) index page.

This change also affects placements where we will always redirect the
user after sign in to the organisations index page.
@CatalinVoineag CatalinVoineag force-pushed the cv/redirect-users-to-org branch from d9d4df0 to fb5f471 Compare January 8, 2024 13:22
Copy link
Contributor

@Nitemaeric Nitemaeric left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Contributor

@elceebee elceebee left a comment

Choose a reason for hiding this comment

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

Tested locally, looks fine to me.

@CatalinVoineag CatalinVoineag merged commit 539ad94 into main Jan 8, 2024
3 checks passed
@CatalinVoineag CatalinVoineag deleted the cv/redirect-users-to-org branch January 8, 2024 13:43
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