Skip to content

Commit

Permalink
fix: use preAuthRedirect to properly redirect (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivyjeong13 authored Feb 19, 2025
1 parent 3ff041b commit 21e6a7e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions auth-providers-common/templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
line-height: 1.25rem;
font-weight: 500;
cursor: pointer;
width: 100%;
}

button:hover {
Expand Down Expand Up @@ -196,6 +197,14 @@
}
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('back-btn').addEventListener('click', function() {
const preAuthUrl = localStorage.getItem('preAuthRedirect');
window.location.href = preAuthUrl;
});
});
</script>
</head>
<body>
<section class="centered">
Expand Down Expand Up @@ -227,9 +236,7 @@ <h1 class="status-title">{{.Title}}</h1>
{{ if .Redirect }}
<div class="columns">
<div class="column">
<form method="GET" action="{{.Redirect}}">
<button type="submit" class="primary">Go Back</button>
</form>
<button id="back-btn" class="primary">Go Back</button>
</div>
</div>
{{ end }}
Expand Down

0 comments on commit 21e6a7e

Please sign in to comment.