Skip to content

Commit

Permalink
fixed bugs in auth/router
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyGermaneri committed Sep 25, 2023
1 parent e33bdaf commit 29db520
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/Auth0AuthenticationProvider/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export class Auth0AuthenticationProvider extends AuthenticationProvider {
this.preferencesStore.$subscribe(setup, { detached: true });
}
async init() {

// begin login/redirect flow

const isCallbackUrl = /auth-callback/.test(self.location.toString());
Expand All @@ -117,7 +116,8 @@ export class Auth0AuthenticationProvider extends AuthenticationProvider {
if (!isAuthenticated && !isCallbackUrl) {
// save the current location in localStore so we can send
// user back there when they respawn
localStorage.setItem(STORE_KEY, self.location.pathname);
localStorage.setItem(STORE_KEY, self.location.pathname
.replace(this.router.options.history.base, ''));
// user must authenticate
this.login();
}
Expand Down Expand Up @@ -167,7 +167,7 @@ export class Auth0AuthenticationProvider extends AuthenticationProvider {
try {
return await this.client.logout({
logoutParams: {
returnTo: 'http://localhost:8080/graph-editor/graphs'
returnTo: 'http://localhost:8080/graph-editor/'
}
});
} catch (err) {
Expand Down
21 changes: 15 additions & 6 deletions packages/Manager/GraphManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<v-app class="graph-editor">
<v-app-bar>
<v-toolbar-title>
<a href="/graph-editor/graphs">
<router-link to="/">
<v-avatar size="40px" color="primary" class="ma-5">
<v-img src="https://avatars1.githubusercontent.com/u/60668496?s=200&v=4"/>
</v-avatar>
</a>
</router-link>
</v-toolbar-title>
<v-spacer/>
<v-btn color="info" @click="create">
Expand All @@ -18,22 +18,22 @@
</v-app-bar>
<v-container fluid class="graphs-container">
<v-row align="center" justify="center">
<v-col v-for="(graph, url) in toc" :key="graph.id" cols="4">
<v-col v-for="graph in filteredToc" :key="graph.id" cols="4">
<v-card>
<v-card-item>
<v-card-title>
<v-icon
height="20px"
width="20px"
class="float-left mr-3 mt-1"
:icon="graph.icon"/>
{{graph.name || url}}
:icon="graph.icon || 'mdi-robot-dead'"/>
{{graph.name || graph.url}}
</v-card-title>
<v-card-text>
{{graph.description || 'No Description'}}
</v-card-text>
<v-card-actions>
<v-btn @click="openGraph(url)">Open</v-btn>
<v-btn @click="() => $router.push(graph.url)">Open</v-btn>
<v-btn>Delete</v-btn>
</v-card-actions>
</v-card-item>
Expand Down Expand Up @@ -75,6 +75,15 @@
'pathPrefix',
]),
...mapWritableState(usePreferencesStore, ['preferences']),
filteredToc() {
if (!this.toc) {
return [];
}
return Object.keys(this.toc).filter((t: any) => !!this.toc[t])
.map((t: any) => {
return {...this.toc[t], url: t}
});
}
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion packages/ShortcutIcons/TopShortcutIcons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div
title="Graph ID"
style="padding-right: 10px;cursor: pointer;">
<v-icon help-topic="openGraph" @click="openGraph" title="Show open graph dialog (^ + O)">
<v-icon help-topic="openGraph" @click="() => $router.push('/')" title="Show open graph dialog (^ + O)">
mdi-folder
</v-icon>
<span v-if="inRewindMode">
Expand Down

0 comments on commit 29db520

Please sign in to comment.