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: SAML login redirects to incorrect room when using an invite #34873

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

matheusbsilva137
Copy link
Member

@matheusbsilva137 matheusbsilva137 commented Jan 3, 2025

Proposed changes (including videos or screenshots)

  • Remove id and redirectUrl from SAML's global ServiceProvideOptions (since they're actually meant to relate to each client/request);
  • Handle invite token redirect on the client side when using SAML (with localStorage).

Issue(s)

Steps to test or reproduce

Further comments

SUP-719

@matheusbsilva137 matheusbsilva137 added this to the 7.3.0 milestone Jan 3, 2025
Copy link
Contributor

dionisio-bot bot commented Jan 3, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link
Contributor

github-actions bot commented Jan 3, 2025

PR Preview Action v1.5.0
🚀 Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34873/
on branch gh-pages at 2025-01-08 17:26 UTC

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 59.13%. Comparing base (9af2774) to head (b2e7d43).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #34873    +/-   ##
=========================================
  Coverage    59.13%   59.13%            
=========================================
  Files         2819     2819            
  Lines        67957    67440   -517     
  Branches     15138    15026   -112     
=========================================
- Hits         40188    39884   -304     
+ Misses       24935    24744   -191     
+ Partials      2834     2812    -22     
Flag Coverage Δ
unit 75.00% <66.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link

changeset-bot bot commented Jan 7, 2025

🦋 Changeset detected

Latest commit: b2e7d43

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@matheusbsilva137 matheusbsilva137 changed the title Fix/global options saml requests fix: SAML login redirects to incorrect room when using an invite Jan 7, 2025
@matheusbsilva137 matheusbsilva137 marked this pull request as ready for review January 7, 2025 20:21
@matheusbsilva137 matheusbsilva137 requested review from a team as code owners January 7, 2025 20:21
MarcosSpessatto
MarcosSpessatto previously approved these changes Jan 8, 2025
@@ -28,7 +30,8 @@ const InvitePage = (): ReactElement => {
return <PageLoading />;
}

if (isValidInvite) {
if (isValidInvite && token) {
localStorage.setItem(KEY, token);
Copy link
Contributor

Choose a reason for hiding this comment

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

invite token should be removed on successful non-SAML login as well.

Possibly needs to also be removed on failed login as well?

Copy link
Member Author

@matheusbsilva137 matheusbsilva137 Jan 8, 2025

Choose a reason for hiding this comment

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

Hmmm am I not covering both cases here already? Real question bc I thought so, but I might me missing something
That mutation is always called since it is responsible for redirecting the user to the invite link

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