Skip to content

Commit 21e6a7e

Browse files
authored
fix: use preAuthRedirect to properly redirect (#447)
1 parent 3ff041b commit 21e6a7e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

auth-providers-common/templates/error.html

+10-3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
line-height: 1.25rem;
9898
font-weight: 500;
9999
cursor: pointer;
100+
width: 100%;
100101
}
101102

102103
button:hover {
@@ -196,6 +197,14 @@
196197
}
197198
}
198199
</style>
200+
<script>
201+
document.addEventListener('DOMContentLoaded', function() {
202+
document.getElementById('back-btn').addEventListener('click', function() {
203+
const preAuthUrl = localStorage.getItem('preAuthRedirect');
204+
window.location.href = preAuthUrl;
205+
});
206+
});
207+
</script>
199208
</head>
200209
<body>
201210
<section class="centered">
@@ -227,9 +236,7 @@ <h1 class="status-title">{{.Title}}</h1>
227236
{{ if .Redirect }}
228237
<div class="columns">
229238
<div class="column">
230-
<form method="GET" action="{{.Redirect}}">
231-
<button type="submit" class="primary">Go Back</button>
232-
</form>
239+
<button id="back-btn" class="primary">Go Back</button>
233240
</div>
234241
</div>
235242
{{ end }}

0 commit comments

Comments
 (0)