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([
|
return view('landing')->with([
|
||||||
'appSettings' => $this->settingService->all()->toJson(),
|
'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(),
|
'lang' => App::currentLocale(),
|
||||||
'isDemoApp' => config("2fauth.config.isDemoApp") ? 'true' : 'false',
|
'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' => [
|
'config' => [
|
||||||
'isDemoApp' => env('IS_DEMO_APP', false),
|
'isDemoApp' => env('IS_DEMO_APP', false),
|
||||||
'trustedProxies' => env('TRUSTED_PROXIES', null),
|
'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',
|
el: '#app',
|
||||||
data: {
|
data: {
|
||||||
appSettings: window.appSettings,
|
appSettings: window.appSettings,
|
||||||
|
appConfig: window.appConfig,
|
||||||
isDemoApp: window.isDemoApp
|
isDemoApp: window.isDemoApp
|
||||||
},
|
},
|
||||||
i18n,
|
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 }}
|
<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>
|
||||||
<div v-else class="content has-text-centered">
|
<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>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</template>
|
</template>
|
||||||
|
9
resources/js/mixins.js
vendored
9
resources/js/mixins.js
vendored
@ -11,10 +11,17 @@ Vue.mixin({
|
|||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
async appLogout(evt) {
|
async appLogout(evt) {
|
||||||
|
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')
|
await this.axios.get('/user/logout')
|
||||||
this.$storage.clear()
|
this.$storage.clear()
|
||||||
location.reload()
|
location.reload()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
exitSettings: function(event) {
|
exitSettings: function(event) {
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var appSettings = {!! $appSettings !!};
|
var appSettings = {!! $appSettings !!};
|
||||||
|
var appConfig = {!! $appConfig !!};
|
||||||
var appVersion = '{{ config("2fauth.version") }}';
|
var appVersion = '{{ config("2fauth.version") }}';
|
||||||
var isDemoApp = {!! $isDemoApp !!};
|
var isDemoApp = {!! $isDemoApp !!};
|
||||||
var appLocales = {!! $locales !!};
|
var appLocales = {!! $locales !!};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user