Skip to content

Commit

Permalink
Merge pull request #55 from iotum/jerry_hu/pop-up-with-sso
Browse files Browse the repository at this point in the history
pop up with sso
  • Loading branch information
jerry2013 authored Sep 11, 2024
2 parents 22e384c + 44d6fa8 commit ea84b9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/components/OpenFullAppButton.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import MenuButtonStyles from '../navigation/MenuButton/MenuButton.module.css';

const OpenFullAppButton = ({ origin }) => {
const OpenFullAppButton = ({ domain, token, hostId }) => {
if (!domain || !token || !hostId) {
return null;
}

const url = new URL('/auth', `https://${domain}`);
url.searchParams.append('host_id', String(hostId));
url.searchParams.append('login_token_public_key', token);
url.searchParams.append('redirect_url', encodeURI('/conf/conferences/create?events=false'));

return (
<div>
<button
type="button"
className={MenuButtonStyles.menuButton}
onClick={() => window.open(`${origin}/conf/conferences/create`, 'portal')}
onClick={() => window.open(url.href, 'portal', 'noreferrer')}
>
open full app
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/list-widget-ui/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const App = () => {
onRoomClose={(path) => toggleRoom(path, false)}
>
<div className={MenuButtonStyles.extraMenu}>
<OpenFullAppButton origin={`https://${credentials.domain}`} />
<OpenFullAppButton {...credentials} />
</div>
</ChatRoomList>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tabbed-dashboard/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ const App = () => {
<div className={MenuButtonStyles.extraMenu}>
{service === Callbridge.Service.Meet && <HiddenAllElementsButton hideDashboardElements={hideDashboardElements} setHideDashboardElements={setHideDashboardElements} />}
{service === Callbridge.Service.Meet && <MultiSelect hideDashboardElements={hideDashboardElements} setHideDashboardElements={setHideDashboardElements} />}
{widgetRef.current && <OpenFullAppButton origin={`https://${credentials.domain}`} />}
{widgetRef.current && <OpenFullAppButton {...credentials} />}
</div>
<div ref={containerRef} className={containerClassName}></div>
</div>
Expand Down

0 comments on commit ea84b9a

Please sign in to comment.