mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-24 14:02:09 +02:00
Fix #82 - Add a proxy logout URL and skip auto lock when it is not set
This commit is contained in:
parent
1aedf4a5c9
commit
6ef67fbc64
@ -32,9 +32,13 @@ class SinglePageController extends Controller
|
||||
{
|
||||
return view('landing')->with([
|
||||
'appSettings' => $this->settingService->all()->toJson(),
|
||||
'appConfig' => collect([
|
||||
'proxyAuth' => config("auth.defaults.guard") === 'reverse-proxy-guard' ? true : false,
|
||||
'proxyLogoutUrl' => config("2fauth.config.proxyLogoutUrl") ? config("2fauth.config.proxyLogoutUrl") : false,
|
||||
])->toJson(),
|
||||
'lang' => App::currentLocale(),
|
||||
'isDemoApp' => config("2fauth.config.isDemoApp") ? 'true' : 'false',
|
||||
'locales' => collect(config("2fauth.locales"))->toJson(),
|
||||
'locales' => collect(config("2fauth.locales"))->toJson()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ return [
|
||||
'config' => [
|
||||
'isDemoApp' => env('IS_DEMO_APP', false),
|
||||
'trustedProxies' => env('TRUSTED_PROXIES', null),
|
||||
'proxyLogoutUrl' => env('PROXY_LOGOUT_URL', null),
|
||||
],
|
||||
|
||||
/*
|
||||
|
1
resources/js/app.js
vendored
1
resources/js/app.js
vendored
@ -16,6 +16,7 @@ const app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
appSettings: window.appSettings,
|
||||
appConfig: window.appConfig,
|
||||
isDemoApp: window.isDemoApp
|
||||
},
|
||||
i18n,
|
||||
|
@ -11,7 +11,10 @@
|
||||
<a class="has-text-grey" href="https://github.com/Bubka/2FAuth"><b>2FAuth</b> <font-awesome-icon :icon="['fab', 'github-alt']" /></a> - v{{ appVersion }}
|
||||
</div>
|
||||
<div v-else class="content has-text-centered">
|
||||
<router-link :to="{ name: 'settings.options' }" class="has-text-grey">{{ $t('settings.settings') }}</router-link> - <a class="has-text-grey" @click="logout">{{ $t('auth.sign_out') }}</a>
|
||||
<router-link :to="{ name: 'settings.options' }" class="has-text-grey">{{ $t('settings.settings') }}</router-link>
|
||||
<span v-if="!this.$root.appConfig.proxyAuth || (this.$root.appConfig.proxyAuth && this.$root.appConfig.proxyLogoutUrl)">
|
||||
- <a class="has-text-grey" @click="logout">{{ $t('auth.sign_out') }}</a>
|
||||
</span>
|
||||
</div>
|
||||
</footer>
|
||||
</template>
|
||||
|
15
resources/js/mixins.js
vendored
15
resources/js/mixins.js
vendored
@ -11,10 +11,17 @@ Vue.mixin({
|
||||
methods: {
|
||||
|
||||
async appLogout(evt) {
|
||||
|
||||
await this.axios.get('/user/logout')
|
||||
this.$storage.clear()
|
||||
location.reload()
|
||||
if (this.$root.appConfig.proxyAuth) {
|
||||
if (this.$root.appConfig.proxyLogoutUrl) {
|
||||
location.assign(this.$root.appConfig.proxyLogoutUrl)
|
||||
}
|
||||
else return false
|
||||
}
|
||||
else {
|
||||
await this.axios.get('/user/logout')
|
||||
this.$storage.clear()
|
||||
location.reload()
|
||||
}
|
||||
},
|
||||
|
||||
exitSettings: function(event) {
|
||||
|
@ -24,6 +24,7 @@
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var appSettings = {!! $appSettings !!};
|
||||
var appConfig = {!! $appConfig !!};
|
||||
var appVersion = '{{ config("2fauth.version") }}';
|
||||
var isDemoApp = {!! $isDemoApp !!};
|
||||
var appLocales = {!! $locales !!};
|
||||
|
Loading…
x
Reference in New Issue
Block a user