Disable the logout method for authentication methods other than… (#934)
Disable the logout method for authentication methods other than 'json' (currently 'proxy' and 'none'.) Resolves #870.pull/942/head
commit
895bb755cd
|
@ -24,7 +24,7 @@
|
||||||
<span>{{ $t('sidebar.settings') }}</span>
|
<span>{{ $t('sidebar.settings') }}</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<button v-if="!noAuth" @click="logout" class="action" id="logout" :aria-label="$t('sidebar.logout')" :title="$t('sidebar.logout')">
|
<button v-if="authMethod == 'json'" @click="logout" class="action" id="logout" :aria-label="$t('sidebar.logout')" :title="$t('sidebar.logout')">
|
||||||
<i class="material-icons">exit_to_app</i>
|
<i class="material-icons">exit_to_app</i>
|
||||||
<span>{{ $t('sidebar.logout') }}</span>
|
<span>{{ $t('sidebar.logout') }}</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapGetters } from 'vuex'
|
import { mapState, mapGetters } from 'vuex'
|
||||||
import * as auth from '@/utils/auth'
|
import * as auth from '@/utils/auth'
|
||||||
import { version, signup, disableExternal, noAuth } from '@/utils/constants'
|
import { version, signup, disableExternal, noAuth, authMethod } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'sidebar',
|
name: 'sidebar',
|
||||||
|
@ -69,7 +69,8 @@ export default {
|
||||||
signup: () => signup,
|
signup: () => signup,
|
||||||
version: () => version,
|
version: () => version,
|
||||||
disableExternal: () => disableExternal,
|
disableExternal: () => disableExternal,
|
||||||
noAuth: () => noAuth
|
noAuth: () => noAuth,
|
||||||
|
authMethod: () => authMethod
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
help () {
|
help () {
|
||||||
|
|
|
@ -8,6 +8,7 @@ const signup = window.FileBrowser.Signup
|
||||||
const version = window.FileBrowser.Version
|
const version = window.FileBrowser.Version
|
||||||
const logoURL = `/${staticURL}/img/logo.svg`
|
const logoURL = `/${staticURL}/img/logo.svg`
|
||||||
const noAuth = window.FileBrowser.NoAuth
|
const noAuth = window.FileBrowser.NoAuth
|
||||||
|
const authMethod = window.FileBrowser.AuthMethod
|
||||||
const loginPage = window.FileBrowser.LoginPage
|
const loginPage = window.FileBrowser.LoginPage
|
||||||
const theme = window.FileBrowser.Theme
|
const theme = window.FileBrowser.Theme
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@ export {
|
||||||
signup,
|
signup,
|
||||||
version,
|
version,
|
||||||
noAuth,
|
noAuth,
|
||||||
|
authMethod,
|
||||||
loginPage,
|
loginPage,
|
||||||
theme
|
theme
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ func handleWithStaticData(w http.ResponseWriter, r *http.Request, d *data, box *
|
||||||
"StaticURL": staticURL,
|
"StaticURL": staticURL,
|
||||||
"Signup": d.settings.Signup,
|
"Signup": d.settings.Signup,
|
||||||
"NoAuth": d.settings.AuthMethod == auth.MethodNoAuth,
|
"NoAuth": d.settings.AuthMethod == auth.MethodNoAuth,
|
||||||
|
"AuthMethod": d.settings.AuthMethod,
|
||||||
"LoginPage": auther.LoginPage(),
|
"LoginPage": auther.LoginPage(),
|
||||||
"CSS": false,
|
"CSS": false,
|
||||||
"ReCaptcha": false,
|
"ReCaptcha": false,
|
||||||
|
|
Loading…
Reference in New Issue