Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(login): implement same device in html #9

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 7 additions & 1 deletion src/main/resources/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ <h4>3. Select the credential.</h4>
/*<![CDATA[*/
let authRequest = /*[[${authRequest}]]*/ "";
let state = /*[[${state}]]*/ ""; // Si 'state' es un identificador único, está bien usarlo
let walletBaseUri = /*[[${walletUri}]]*/ "";
/*]]>*/
</script>
<script src="https://cdn.jsdelivr.net/sockjs/latest/sockjs.min.js"></script>
Expand Down Expand Up @@ -328,8 +329,13 @@ <h4>3. Select the credential.</h4>
// Función para configurar el enlace del botón con el authRequest
function configureAuthRequest() {
const walletButton = document.getElementById('dome-wallet-button');

if (walletBaseUri && !walletBaseUri.endsWith("/")) {
walletBaseUri += "/";
}

if (authRequest) {
let walletUri = authRequest.replace("openid4vp://", "https://wallet.dome-marketplace.org");
let walletUri = authRequest.replace("openid4vp://", walletBaseUri);
walletButton.onclick = () => window.location.href = walletUri;
}
}
Expand Down
Loading