Skip to content

Commit

Permalink
Merge branch '16' into 'master'
Browse files Browse the repository at this point in the history
#16 Use HTML history and redirect correctly when not logged in

See merge request linagora/lgs/openpaas/openpaas-videoconference-app!24
  • Loading branch information
Christophe HENRY committed Nov 22, 2018
2 parents 8116a1a + e2c3dad commit d077d97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/ApplicationsMenu.vue
Expand Up @@ -13,7 +13,7 @@
<v-container grid-list-xl fluid>
<v-layout row wrap>
<v-flex xs4 d-flex>
<router-link :to="{ name: 'home' }">
<router-link :to="{ name: 'Home' }">
<v-icon large color="blue">home</v-icon>
</router-link>
</v-flex>
Expand Down
4 changes: 3 additions & 1 deletion src/router.js
Expand Up @@ -6,10 +6,12 @@ import VideoConference from "@/views/VideoConference.vue";
Vue.use(Router);

export default new Router({
base: process.env.BASE_URL, // Needed for dev/build and HTML history
mode: "history",
routes: [
{
path: "/",
name: "home",
name: "Home",
redirect: {
name: "VideoConference",
params: { conferenceid: process.env.VUE_APP_JITSI_DEFAULT_CONFERENCE_ROOM }
Expand Down
6 changes: 4 additions & 2 deletions src/views/Login.vue
Expand Up @@ -38,8 +38,10 @@ export default {
},
methods: {
login() {
const redirectHistory = this.$auth.redirect();
const redirect = redirectHistory ? { name: redirectHistory.from.name, params: redirectHistory.from.params } : { name: 'Home' };
this.logMeIn = true;
const redirect = this.$auth.redirect();
this.$auth
.login({
url: "api/jwt/generate",
Expand All @@ -48,7 +50,7 @@ export default {
password: this.password
},
rememberMe: false,
redirect: { path: redirect.from.path }
redirect
})
.then(response => {
this.$store.dispatch("session/setJWTToken", response.data);
Expand Down

0 comments on commit d077d97

Please sign in to comment.