Skip to content

Commit f010990

Browse files
committed
add dice callback page
1 parent fbc3e3c commit f010990

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

src/server/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ async function onExpressJsSetup(server) {
313313
* page would do on signing / rejecting a document. */
314314
server.use('/community-app-assets/api/mock/docu-sign', (req, res) => setTimeout(() => res.send(mockDocuSignFactory(req.query.returnUrl)), 3000));
315315

316+
server.use('/community-app-assets/dice-signin-callback.html', (req, res) => res.sendFile(path.resolve(__dirname, './static/dice-signin-callback.html')));
317+
316318
/* TODO:
317319
* This is a temporary fallback route: some of the assets in the app are not
318320
* properly packed with Webpack, and they rely on just being copied into some
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<title>Processing verfiable credentials</title>
6+
</head>
7+
8+
<body>
9+
<noscript> You need to enable JavaScript to run this app. </noscript>
10+
11+
<h1>Verifying credentials....</h1>
12+
13+
<script src="https://cdnjs.cloudflare.com/ajax/libs/oidc-client/1.11.5/oidc-client.min.js"
14+
integrity="sha512-pGtU1n/6GJ8fu6bjYVGIOT9Dphaw5IWPwVlqkpvVgqBxFkvdNbytUh0H8AP15NYF777P4D3XEeA/uDWFCpSQ1g=="
15+
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
16+
<script>
17+
new Oidc.UserManager().signinPopupCallback()
18+
</script>
19+
</body>
20+
21+
</html>

src/shared/components/Settings/Account/Security/index.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,16 @@ export default function Security({
103103

104104
const verificationPopup = () => {
105105
const diceUrl = config.DICE_VERIFIER_URL;
106-
const accountsAuth = config.URL.AUTH;
106+
let baseRedirectUrl = config.URL.BASE;
107+
if (baseRedirectUrl.indexOf('-dev') !== -1) {
108+
baseRedirectUrl = window.location.origin;
109+
}
107110
const manager = new UserManager({
108111
authority: diceUrl,
109112
client_id: 'topcoder',
110113
response_type: 'code',
111114
scope: 'openid profile vc_authn',
112-
popup_redirect_uri: `${accountsAuth}/dice-verify-callback.html`,
115+
popup_redirect_uri: `${baseRedirectUrl}/community-app-assets/dice-signin-callback.html`,
113116
response_mode: 'query',
114117
loadUserInfo: false,
115118
popupWindowFeatures: 'location=no,toolbar=no,menubar=no,width=1000,height=611,left=100,top=100',

0 commit comments

Comments
 (0)