mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-23 13:51:13 +01:00
Close #96 - Set unique page titles
This commit is contained in:
parent
cb2de26e93
commit
98bd9ddea5
2
resources/js/app.js
vendored
2
resources/js/app.js
vendored
@ -1,9 +1,9 @@
|
||||
import Vue from 'vue'
|
||||
import mixins from './mixins'
|
||||
import VueStorage from './packages/vue-storage'
|
||||
import i18n from './langs/i18n'
|
||||
import router from './routes'
|
||||
import api from './api'
|
||||
import i18n from './langs/i18n'
|
||||
import FontAwesome from './packages/fontawesome'
|
||||
import Clipboard from './packages/clipboard'
|
||||
import Notifications from 'vue-notification'
|
||||
|
@ -32,11 +32,11 @@
|
||||
},
|
||||
{
|
||||
'name' : this.$t('settings.oauth'),
|
||||
'view' : 'settings.oauth'
|
||||
'view' : 'settings.oauth.tokens'
|
||||
},
|
||||
{
|
||||
'name' : this.$t('settings.webauthn'),
|
||||
'view' : 'settings.webauthn'
|
||||
'view' : 'settings.webauthn.devices'
|
||||
},
|
||||
]
|
||||
}
|
||||
|
10
resources/js/routes.js
vendored
10
resources/js/routes.js
vendored
@ -45,10 +45,10 @@ const router = new Router({
|
||||
|
||||
{ path: '/settings/options', name: 'settings.options', component: SettingsOptions, meta: { requiresAuth: true } },
|
||||
{ path: '/settings/account', name: 'settings.account', component: SettingsAccount, meta: { requiresAuth: true } },
|
||||
{ path: '/settings/oauth', name: 'settings.oauth', component: SettingsOAuth, meta: { requiresAuth: true } },
|
||||
{ path: '/settings/webauthn/:credentialId/edit', name: 'settings.webauthn.editCredential', component: EditCredential, meta: { requiresAuth: true }, props: true },
|
||||
{ path: '/settings/webauthn', name: 'settings.webauthn', component: SettingsWebAuthn, meta: { requiresAuth: true } },
|
||||
{ path: '/settings/oauth', name: 'settings.oauth.tokens', component: SettingsOAuth, meta: { requiresAuth: true } },
|
||||
{ path: '/settings/oauth/pat/create', name: 'settings.oauth.generatePAT', component: GeneratePAT, meta: { requiresAuth: true } },
|
||||
{ path: '/settings/webauthn/:credentialId/edit', name: 'settings.webauthn.editCredential', component: EditCredential, meta: { requiresAuth: true }, props: true },
|
||||
{ path: '/settings/webauthn', name: 'settings.webauthn.devices', component: SettingsWebAuthn, meta: { requiresAuth: true } },
|
||||
|
||||
{ path: '/login', name: 'login', component: Login, meta: { disabledWithAuthProxy: true } },
|
||||
{ path: '/register', name: 'register', component: Register, meta: { disabledWithAuthProxy: true } },
|
||||
@ -66,7 +66,9 @@ const router = new Router({
|
||||
let isFirstLoad = true;
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
|
||||
|
||||
document.title = router.app.$options.i18n.t('titles.' + to.name)
|
||||
|
||||
if( to.name === 'accounts') {
|
||||
to.params.isFirstLoad = isFirstLoad ? true : false
|
||||
isFirstLoad = false;
|
||||
|
@ -36,14 +36,14 @@
|
||||
await this.form.patch('/webauthn/credentials/' + this.id + '/name')
|
||||
|
||||
if( this.form.errors.any() === false ) {
|
||||
this.$router.push({name: 'settings.webauthn', params: { toRefresh: true }})
|
||||
this.$router.push({name: 'settings.webauthn.devices', params: { toRefresh: true }})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
cancelCreation: function() {
|
||||
|
||||
this.$router.push({ name: 'settings.webauthn' });
|
||||
this.$router.push({ name: 'settings.webauthn.devices' });
|
||||
},
|
||||
|
||||
},
|
||||
|
@ -34,14 +34,14 @@
|
||||
const { data } = await this.form.post('/oauth/personal-access-tokens')
|
||||
|
||||
if( this.form.errors.any() === false ) {
|
||||
this.$router.push({ name: 'settings.oauth', params: { accessToken: data.accessToken, token_id: data.token.id } });
|
||||
this.$router.push({ name: 'settings.oauth.tokens', params: { accessToken: data.accessToken, token_id: data.token.id } });
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
cancelGeneration: function() {
|
||||
|
||||
this.$router.push({ name: 'settings.oauth' });
|
||||
this.$router.push({ name: 'settings.oauth.tokens' });
|
||||
},
|
||||
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<setting-tabs :activeTab="'settings.webauthn'"></setting-tabs>
|
||||
<setting-tabs :activeTab="'settings.webauthn.devices'"></setting-tabs>
|
||||
<div class="options-tabs">
|
||||
<form-wrapper>
|
||||
<div v-if="isRemoteUser" class="notification is-warning has-text-centered" v-html="$t('auth.auth_handled_by_proxy')" />
|
||||
|
47
resources/lang/en/titles.php
Normal file
47
resources/lang/en/titles.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Titles Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'start' => 'New account',
|
||||
'capture' => 'Flash QR',
|
||||
'accounts' => 'Accounts',
|
||||
'createAccount' => 'Create account',
|
||||
'importAccounts' => 'Import accounts',
|
||||
'editAccount' => 'Account edit',
|
||||
'showQRcode' => 'Account as QR code',
|
||||
'groups' => 'Groups',
|
||||
'createGroup' => 'Create group',
|
||||
'editGroup' => 'Group edit',
|
||||
'settings' => [
|
||||
'options' => 'Options',
|
||||
'account' => 'User account',
|
||||
'oauth' => [
|
||||
'tokens' => 'OAuth tokens',
|
||||
'generatePAT' => 'New personal token',
|
||||
],
|
||||
'webauthn' => [
|
||||
'editCredential' => 'Device edit',
|
||||
'devices' => 'WebAuthn devices',
|
||||
],
|
||||
],
|
||||
'login' => 'Login',
|
||||
'register' => 'Register',
|
||||
'password' => [
|
||||
'request' => 'Reset password',
|
||||
'reset' => 'New password',
|
||||
],
|
||||
'webauthn' => [
|
||||
'lost' => 'Account recovery',
|
||||
'recover' => 'Register a new device',
|
||||
],
|
||||
'flooded' => 'Flood',
|
||||
'genericError' => 'Error',
|
||||
'404' => 'Item not found',
|
||||
];
|
Loading…
Reference in New Issue
Block a user