diff --git a/src/app/TopNav.vue b/src/app/TopNav.vue
index c7ae8dc..e0c72f6 100644
--- a/src/app/TopNav.vue
+++ b/src/app/TopNav.vue
@@ -9,9 +9,21 @@
-
+
+
+
+
+
+
+
+ {{ server }}
+
+
+ {{ username }}
+
+
- Logout
+ Log out
@@ -27,7 +39,10 @@ import SearchForm from '@/search/SearchForm.vue';
SearchForm,
},
computed: {
- ...mapState(["username"])
+ ...mapState([
+ "server",
+ "username",
+ ])
},
methods: {
...mapMutations([
diff --git a/src/auth/Login.vue b/src/auth/Login.vue
index 22e8e36..058a754 100644
--- a/src/auth/Login.vue
+++ b/src/auth/Login.vue
@@ -51,7 +51,10 @@ export default Vue.extend({
this.username = await this.$auth.username;
const success = await this.$auth.autoLogin();
if (success) {
- this.$store.commit("setLoginSuccess", { username: this.username});
+ this.$store.commit("setLoginSuccess", {
+ username: this.username,
+ server: this.server,
+ });
this.$router.push(this.returnTo);
} else {
this.showModal = true;
@@ -62,7 +65,10 @@ export default Vue.extend({
this.busy = true;
this.$auth.loginWithPassword(this.server, this.username, this.password, this.rememberLogin)
.then(() => {
- this.$store.commit("setLoginSuccess", { username: this.username });
+ this.$store.commit("setLoginSuccess", {
+ username: this.username,
+ server: this.server,
+ });
this.$router.push(this.returnTo);
})
.catch(err => {
diff --git a/src/shared/components/Icon.vue b/src/shared/components/Icon.vue
index f5fb873..5da8587 100644
--- a/src/shared/components/Icon.vue
+++ b/src/shared/components/Icon.vue
@@ -19,6 +19,7 @@
BIconThreeDotsVertical,
BIconMusicNoteBeamed,
BIconBoxArrowRight,
+ BIconPersonFill,
} from 'bootstrap-vue'
export default Vue.extend({
@@ -38,6 +39,7 @@
BIconThreeDotsVertical,
BIconMusicNoteBeamed,
BIconBoxArrowRight,
+ BIconPersonFill,
},
props: {
icon: { type: String }
diff --git a/src/shared/store.ts b/src/shared/store.ts
index ff2b926..23c7099 100644
--- a/src/shared/store.ts
+++ b/src/shared/store.ts
@@ -9,6 +9,7 @@ import { API } from './api';
interface State {
isLoggedIn: boolean;
username: null | string;
+ server: null | string;
showMenu: boolean;
error: Error | null;
playlists: any[];
@@ -18,6 +19,7 @@ const setupRootModule = (authService: AuthService, api: API): Module
state: {
isLoggedIn: false,
username: null,
+ server: null,
showMenu: false,
error: null,
playlists: [],
@@ -29,9 +31,10 @@ const setupRootModule = (authService: AuthService, api: API): Module
clearError(state) {
state.error = null;
},
- setLoginSuccess(state, { username }) {
+ setLoginSuccess(state, { username, server }) {
state.isLoggedIn = true;
state.username = username;
+ state.server = server;
},
toggleMenu(state) {
state.showMenu = !state.showMenu;