Skip to content

Commit abd40ae

Browse files
authored
Fix bug that broke redirection when logging in via OIDC (#196)
1 parent c8070c5 commit abd40ae

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/router/index.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,15 @@ const routes = [
2929
},
3030
{
3131
path: "/",
32-
redirect: { name: "ObservableMatch" },
32+
redirect: to => {
33+
if (localStorage.getItem("next") !== null) {
34+
let redirect_uri = localStorage.getItem("next");
35+
localStorage.removeItem("next");
36+
return { path: redirect_uri };
37+
} else {
38+
return { name: "ObservableMatch" };
39+
}
40+
},
3341
name: "Home"
3442
},
3543
{

src/views/Login.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</v-card-text>
1616
<v-card-text v-if="authModule === 'oidc'">
1717
<v-btn
18-
@click="userStore.OIDCBrowserRedirect"
18+
@click="OIDCBrowserRedirect"
1919
block
2020
rounded="xs"
2121
size="large"
@@ -49,6 +49,10 @@ export default {
4949
};
5050
},
5151
methods: {
52+
OIDCBrowserRedirect() {
53+
localStorage.setItem("next", this.$route.query.next);
54+
this.userStore.OIDCBrowserRedirect();
55+
},
5256
OIDCAsyncRefresh() {
5357
this.userStore
5458
.OIDCAsyncRefresh()

0 commit comments

Comments
 (0)