Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion web/src/pages/openidCallback/components/OpenIDCallbackCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ export const OpenIDCallbackCard = () => {
return undefined;
}, [data]);

const deepLink = useMemo(() => {
if (data) {
return `defguard://addinstance?token=${data.token}&url=${data.url}`;
}
return null;
}, [data]);

if (isLoading) {
return (
<div className="loader-container">
Expand Down Expand Up @@ -125,14 +132,26 @@ export const OpenIDCallbackCard = () => {
<BigInfoBox message={LL.pages.oidcLogin.card.infoBox()} />
<h3>
Please enter the provided Instance URL and Token into your Defguard Client. You
can scan the QR code or copy and paste the token manually.
can scan the QR code, click the button below or copy and paste the token manually.
</h3>
{isPresent(data) && (
<>
<CopyField label="Url" value={data.url} onCopy={writeToClipboard} />
<CopyField label="Token" value={data.token} onCopy={writeToClipboard} />
</>
)}

{isPresent(deepLink) && (
<div className="row">
<a href={deepLink} target="_blank" rel="noopener noreferrer">
<Button
text="Configure your desktop client"
size={ButtonSize.LARGE}
styleVariant={ButtonStyleVariant.PRIMARY}
/>
</a>
</div>
)}
{isPresent(qrData) && (
<div className="row">
<div className="qr">
Expand Down