Skip to content

Commit 52e8911

Browse files
committed
update env build
1 parent b2afdd6 commit 52e8911

File tree

5 files changed

+30
-21
lines changed

5 files changed

+30
-21
lines changed

build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ OTPFILENAME="./web-assets/js/otp.js"
2020
perl -pi -e "s/\{\{DOMAIN\}\}/$DOMAIN/g" $OTPFILENAME
2121
perl -pi -e "s/\{\{AUTH0DOMAIN\}\}/$AUTH0DOMAIN/g" $OTPFILENAME
2222

23+
DICECALLBACK="./web-assets/static-pages/dice-verify-callback.html"
24+
perl -pi -e "s/\{\{DOMAIN\}\}/$DOMAIN/g" $DICECALLBACK
25+
perl -pi -e "s/\{\{DICE_AUTH\}\}/$DICE_AUTH/g" $DICECALLBACK
26+
perl -pi -e "s/\{\{CA_SUB_1\}\}/$CA_SUB_1/g" $DICECALLBACK
27+
28+
DICEVERIFIER="./web-assets/static-pages/dice-verifier.html"
29+
perl -pi -e "s/\{\{DOMAIN\}\}/$DOMAIN/g" $DICEVERIFIER
30+
perl -pi -e "s/\{\{DICE_AUTH\}\}/$DICE_AUTH/g" $DICEVERIFIER
31+
2332
mkdir dist
2433
cp -rv ./web-assets/css/* ./dist/
2534
cp -rv ./web-assets/js/* ./dist/

web-assets/css/otp.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ input[type="number"] {
5353
flex-direction: column;
5454
align-items: center;
5555
padding: 42px 40px;
56-
gap: 51px;
5756
}
5857

5958
.signin-header {
@@ -62,6 +61,7 @@ input[type="number"] {
6261
align-items: center;
6362
padding: 0;
6463
gap: 8px;
64+
margin-bottom: 51px;
6565
}
6666

6767
.header-text {
@@ -83,18 +83,19 @@ input[type="number"] {
8383
line-height: 24px;
8484
color: #767676;
8585
padding: 12px;
86+
margin-bottom: 51px;
8687
}
8788

8889
.messages {
8990
width: 100%;
9091
display: flex;
9192
flex-direction: column;
9293
gap: 12px;
93-
display: none;
9494
}
9595

9696
.message-wrapper {
9797
display: none;
98+
margin-bottom: 20px;
9899
}
99100

100101
.message {

web-assets/js/otp.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,16 @@ $(document).ready(function () {
3030
success: function (result) {
3131
$("#notify").html("Email sent");
3232
$("#notify").closest(".message-wrapper").fadeIn();
33-
$("#notify").closest(".messages").fadeIn();
3433
$("#resend").hide();
3534
},
3635
error: function (error) {
3736
if (error.responseJSON && error.responseJSON.result) {
3837
$("#error").html(error.responseJSON.result.content);
3938
$("#error").closest(".message-wrapper").fadeIn();
40-
$("#error").closest(".messages").fadeIn();
4139
$("#resend").hide();
4240
} else {
4341
$("#error").html("Unknown Error");
4442
$("#error").closest(".message-wrapper").fadeIn();
45-
$("#error").closest(".messages").fadeIn();
4643
}
4744
}
4845
});
@@ -54,12 +51,10 @@ $(document).ready(function () {
5451
if (errorMessage) {
5552
$("#error").html(errorMessage);
5653
$("#error").closest(".message-wrapper").fadeIn();
57-
$("#error").closest(".messages").fadeIn();
5854
}
5955

6056
$(".close-error").on("click", function () {
6157
$(this).closest(".message-wrapper").fadeOut();
62-
$(this).closest(".messages").fadeOut();
6358
});
6459
});
6560

@@ -132,6 +127,7 @@ const keydownHandler = (e, prefix, currentPosition) => {
132127
if (elem) {
133128
elem.focus();
134129
elem.select();
130+
elem.value = "";
135131
e.preventDefault();
136132
return;
137133
}

web-assets/static-pages/dice-verifier.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
1414
<script>
1515
const manager = new Oidc.UserManager({
16-
authority: 'https://tc-vcauth-uat.diceid.com',
16+
authority: 'https://{{DICE_AUTH}}.diceid.com',
1717
client_id: 'topcoder',
1818
response_type: 'code',
1919
scope: 'openid profile vc_authn',
20-
redirect_uri: 'https://accounts-auth0.topcoder-dev.com/dice-verify-callback.html',
20+
redirect_uri: 'https://accounts-auth0.{{DOMAIN}}/dice-verify-callback.html',
2121
response_mode: 'query',
2222
loadUserInfo: false,
2323
});
2424
manager.settings.metadata = {
25-
issuer: 'https://tc-vcauth-uat.diceid.com',
26-
jwks_uri: 'https://tc-vcauth-uat.diceid.com/.well-known/openid-configuration/jwks',
27-
authorization_endpoint: 'https://tc-vcauth-uat.diceid.com/vc/connect/authorize?pres_req_conf_id=Topcoder_2FA_Validate_Cred',
28-
token_endpoint: 'https://tc-vcauth-uat.diceid.com/vc/connect/token',
29-
userinfo_endpoint: 'https://tc-vcauth-uat.diceid.com/connect/userinfo',
30-
check_session_iframe: 'https://tc-vcauth-uat.diceid.com/vc/connect/checksession',
31-
revocation_endpoint: 'https://tc-vcauth-uat.diceid.com/vc/connect/revocation',
25+
issuer: 'https://{{DICE_AUTH}}.diceid.com',
26+
jwks_uri: 'https://{{DICE_AUTH}}.diceid.com/.well-known/openid-configuration/jwks',
27+
authorization_endpoint: 'https://{{DICE_AUTH}}.diceid.com/vc/connect/authorize?pres_req_conf_id=Topcoder_2FA_Validate_Cred',
28+
token_endpoint: 'https://{{DICE_AUTH}}.diceid.com/vc/connect/token',
29+
userinfo_endpoint: 'https://{{DICE_AUTH}}.diceid.com/connect/userinfo',
30+
check_session_iframe: 'https://{{DICE_AUTH}}.diceid.com/vc/connect/checksession',
31+
revocation_endpoint: 'https://{{DICE_AUTH}}.diceid.com/vc/connect/revocation',
3232
};
3333
manager.signinRedirect();
3434
</script>

web-assets/static-pages/dice-verify-callback.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@
1717
loadUserInfo: false
1818
});
1919
userManager.settings.metadata = {
20-
issuer: `https://tc-vcauth-uat.diceid.com`,
21-
token_endpoint: `https://tc-vcauth-uat.diceid.com/vc/connect/token`
20+
issuer: `https://{{DICE_AUTH}}.diceid.com`,
21+
token_endpoint: `https://{{DICE_AUTH}}.diceid.com/vc/connect/token`
2222
};
2323
userManager.signinRedirectCallback().then(
2424
(user) => {
25-
console.log(user)
26-
window.parent.postMessage(user, 'https://accounts-auth0.topcoder-dev.com')
25+
window.parent.postMessage({ type: 'DICE_VERIFICATION', success: true, user }, 'https://www.{{DOMAIN}}')
26+
window.parent.postMessage({ type: 'DICE_VERIFICATION', success: true, user }, 'https://community-app.{{DOMAIN}}')
27+
window.parent.postMessage({ type: 'DICE_VERIFICATION', success: true, user }, 'https://{{CA_SUB_1}}.{{DOMAIN}}')
2728
},
2829
(error) => {
2930
console.log(error)
30-
window.parent.postMessage({}, 'https://accounts-auth0.topcoder-dev.com')
31+
window.parent.postMessage({ type: 'DICE_VERIFICATION', success: false }, 'https://www.{{DOMAIN}}')
32+
window.parent.postMessage({ type: 'DICE_VERIFICATION', success: false }, 'https://community-app.{{DOMAIN}}')
33+
window.parent.postMessage({ type: 'DICE_VERIFICATION', success: false }, 'https://{{CA_SUB_1}}.{{DOMAIN}}')
3134
}
3235
);
3336
</script>

0 commit comments

Comments
 (0)