Skip to content

Commit afb4de9

Browse files
Feat: create SSO user account on platform
1 parent bc5c8ca commit afb4de9

File tree

9 files changed

+421
-158
lines changed

9 files changed

+421
-158
lines changed

apps/OpenSign/src/components/sidebar/Menu.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const Menu = ({ item, isOpen, closeSidebar }) => {
1010
? `/${item.pageType}/${item.objectId}`
1111
: `/${item.objectId}`
1212
}
13-
className="mx-auto flex items-center hover:bg-[#eef1f5] p-3 lg:p-4 cursor-pointer focus:text-[#0056b3] focus:bg-[#eef1f5]"
13+
className={({ isActive }) =>
14+
`${
15+
isActive ? "text-[#0056b3] bg-[#eef1f5]" : ""
16+
} mx-auto flex items-center hover:bg-[#eef1f5] p-3 lg:p-4 cursor-pointer`
17+
}
1418
onClick={closeSidebar}
1519
tabIndex={isOpen ? 0 : -1}
1620
role="menuitem"

apps/OpenSign/src/constant/Utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ export const isMobile = window.innerWidth < 767;
1212
export const textInputWidget = "text input";
1313
export const textWidget = "text";
1414
export const radioButtonWidget = "radio button";
15-
export const openInNewTab = (url) => {
16-
window.open(url, "_blank", "noopener,noreferrer");
15+
export const openInNewTab = (url, target) => {
16+
if (target) {
17+
window.open(url, target, "noopener,noreferrer");
18+
} else {
19+
window.open(url, "_blank", "noopener,noreferrer");
20+
}
1721
};
1822

1923
export async function fetchSubscription(

apps/OpenSign/src/pages/Login.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,10 +1041,15 @@ function Login() {
10411041
localStorage.setItem("baseUrl", baseUrl);
10421042
localStorage.setItem("parseAppId", appid);
10431043
};
1044+
1045+
// `handleSignInWithSSO` is trigger when user click sign in with sso and open sso authorize endpoint
10441046
const handleSignInWithSSO = () => {
10451047
if (state?.email) {
1048+
const encodedEmail = encodeURIComponent(state.email);
1049+
const clientUrl = window.location.origin;
10461050
openInNewTab(
1047-
`https://osl-jacksonv2.vercel.app/api/oauth/authorize?response_type=code&provider=saml&tenant=Okta-dev-nxglabs-in&product=OpenSign&redirect_uri=http://localhost:3000/sso&state=${state.email}`
1051+
`https://osl-jacksonv2.vercel.app/api/oauth/authorize?response_type=code&provider=saml&tenant=Okta-dev-nxglabs-in&product=OpenSign&redirect_uri=${clientUrl}/sso&state=${encodedEmail}`,
1052+
"_self"
10481053
);
10491054
} else {
10501055
alert("Please provide email.");

0 commit comments

Comments
 (0)