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/asub 8551 apple signin redirect #2184

Merged

Conversation

accbjt
Copy link
Contributor

@accbjt accbjt commented Jul 18, 2024

Be sure to run npm test, npm run lint, and write detailed test steps before requesting reviewers

Description

Jira Ticket: THEMES-

Information about what you changed for this PR. Include any dependencies, companion PRs, relevant screenshots, or config changes.

Test Steps

Add detailed test steps a reviewer must complete to test this PR

Video recording of testing this locally. I created this so you don't have to set this up on your local machine. This depends heavily on the Apple sign on implementation on subssinglesite and is decent amount of work to get it setup locally.

https://www.loom.com/share/2b1bbc5bd69348c9ac3e05b1c09a4f4a?sid=194460fd-1cee-46d5-8ea8-1c2dd085e698

Here is another example on an article page.

https://www.loom.com/share/c0a83222672a4ab885ff7a4d1b26a278?sid=0608528b-9acf-42c0-a87c-41f2b5b0cf71

@accbjt accbjt requested a review from a team as a code owner July 18, 2024 05:51
blocks/identity-block/components/login/index.jsx Dismissed Show dismissed Hide dismissed
blocks/identity-block/components/login/index.jsx Dismissed Show dismissed Hide dismissed
setCurrentRedirectToURL(`${redirectURL}${redirectUrlLocation.search}`);
const newRedirectUrl = `${redirectURL}${redirectUrlLocation.search}`;

setRedirectUrl(newRedirectUrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

@accbjt I think we can define a let newRedirectUrl and move this line out from the if-else statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@LauraPinilla Okay, I made those updates.

@accbjt accbjt requested a review from LauraPinilla July 22, 2024 23:18
@@ -13,6 +13,7 @@ const validateURL = (url) => {
return url;
}

sessionStorage.setItem("ArcXP_redirectUrl", "/");
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @accbjt, why are you setting ArcXP_redirectUrl to "/". Sounds like the value we are setting here should depend on the custom fields or the page in which the user is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@LauraPinilla The original validateURL return '/' if the url is not valid so I was just following what they set in that function. I think if the url is not a valid url then it is okay to set it as /. That is the original logic and I don't want to change that and make it more complicated.

LauraPinilla
LauraPinilla previously approved these changes Jul 23, 2024
Copy link
Contributor

@LauraPinilla LauraPinilla left a comment

Choose a reason for hiding this comment

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

lgtm!

@accbjt accbjt added the ready for review The PR author has completed the PR template and is ready for a review label Jul 24, 2024
Copy link
Contributor

@malavikakoppula malavikakoppula left a comment

Choose a reason for hiding this comment

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

@accbjt very small update removing newlines in multiple components. Everything else is look good

@@ -21,6 +21,7 @@ function useSocialSignIn(redirectURL, isOIDC, socialSignOnIn, onError = () => {}
loginByOIDC();
} else {
const validatedURL = validateURL(redirectURL);

Copy link
Contributor

Choose a reason for hiding this comment

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

@accbjt Can you please revert this new line

@@ -51,6 +52,7 @@ function useSocialSignIn(redirectURL, isOIDC, socialSignOnIn, onError = () => {}
loginByOIDC();
} else {
const validatedURL = validateURL(redirectURL);

Copy link
Contributor

Choose a reason for hiding this comment

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

@accbjt Same here

@@ -43,6 +43,7 @@ function AccountManagement({ customFields }) {
const checkLoggedInStatus = () =>
Identity.isLoggedIn().then((isLoggedIn) => {
if (!isLoggedIn) {

Copy link
Contributor

Choose a reason for hiding this comment

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

@accbjt same here

@@ -90,6 +90,7 @@ const Login = ({ customFields }) => {
loginByOIDC();
} else {
const validatedURL = validateURL(loginRedirect);

Copy link
Contributor

Choose a reason for hiding this comment

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

@accbjt same here

@accbjt
Copy link
Contributor Author

accbjt commented Jul 24, 2024

@malavikakoppula Okay, I made those changes. Thanks

Copy link
Contributor

@malavikakoppula malavikakoppula left a comment

Choose a reason for hiding this comment

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

LGTM

@accbjt accbjt merged commit 236fba9 into arc-themes-release-version-2.5.0 Jul 29, 2024
8 checks passed
@accbjt accbjt deleted the fix/ASUB-8551-apple-signin-redirect branch July 29, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review The PR author has completed the PR template and is ready for a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants