This commit is contained in:
Jonathan Bout 2024-05-19 11:26:52 -04:00 committed by GitHub
commit 65aa91cef1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 14 deletions

View File

@ -1,6 +1,10 @@
<template>
<div v-show="active" @click="closeHovers" class="overlay"></div>
<nav :class="{ active }">
<button v-if="user.username" @click="toAccountSettings" class="action">
<i class="material-icons">person</i>
<span>{{ user.username }}</span>
</button>
<template v-if="isLoggedIn">
<button
class="action"
@ -34,7 +38,7 @@
</button>
</div>
<div>
<div v-if="user.perm.admin">
<button
class="action"
@click="toSettings"
@ -44,19 +48,18 @@
<i class="material-icons">settings_applications</i>
<span>{{ $t("sidebar.settings") }}</span>
</button>
<button
v-if="canLogout"
@click="logout"
class="action"
id="logout"
:aria-label="$t('sidebar.logout')"
:title="$t('sidebar.logout')"
>
<i class="material-icons">exit_to_app</i>
<span>{{ $t("sidebar.logout") }}</span>
</button>
</div>
<button
v-if="canLogout"
@click="logout"
class="action"
id="logout"
:aria-label="$t('sidebar.logout')"
:title="$t('sidebar.logout')"
>
<i class="material-icons">exit_to_app</i>
<span>{{ $t("sidebar.logout") }}</span>
</button>
</template>
<template v-else>
<router-link
@ -181,8 +184,12 @@ export default {
this.$router.push({ path: "/files" });
this.closeHovers();
},
toAccountSettings() {
this.$router.push({ path: "/settings/profile" });
this.$store.commit("closeHovers");
},
toSettings() {
this.$router.push({ path: "/settings" });
this.$router.push({ path: "/settings/global" });
this.closeHovers();
},
help() {

View File

@ -30,6 +30,7 @@ type userInfo struct {
LockPassword bool `json:"lockPassword"`
HideDotfiles bool `json:"hideDotfiles"`
DateFormat bool `json:"dateFormat"`
Username string `json:"username"`
}
type authToken struct {
@ -195,6 +196,7 @@ func printToken(w http.ResponseWriter, _ *http.Request, d *data, user *users.Use
Commands: user.Commands,
HideDotfiles: user.HideDotfiles,
DateFormat: user.DateFormat,
Username: user.Username,
},
RegisteredClaims: jwt.RegisteredClaims{
IssuedAt: jwt.NewNumericDate(time.Now()),