Code cleanup

This commit is contained in:
Dane Everitt 2018-04-08 16:00:52 -05:00
parent 6d970a4cc3
commit b6e94d9a1e
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 14 additions and 41 deletions

View file

@ -35,8 +35,6 @@ class LoginController extends AbstractLoginController
$username = $request->input('user'); $username = $request->input('user');
$useColumn = $this->getField($username); $useColumn = $this->getField($username);
sleep(1);
if ($this->hasTooManyLoginAttempts($request)) { if ($this->hasTooManyLoginAttempts($request)) {
$this->fireLockoutEvent($request); $this->fireLockoutEvent($request);
$this->sendLockoutResponse($request); $this->sendLockoutResponse($request);

View file

@ -18,26 +18,15 @@ window.Ziggy = Ziggy;
Vue.use(Vuex); Vue.use(Vuex);
const store = new Vuex.Store({ const store = new Vuex.Store({ plugins: [createFlashStore()] });
plugins: [
createFlashStore(),
],
});
const route = require('./../../../../vendor/tightenco/ziggy/src/js/route').default; const route = require('./../../../../vendor/tightenco/ziggy/src/js/route').default;
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.mixin({ Vue.mixin({ methods: { route } });
methods: {
route: route,
},
});
Vue.use(VueRouter); Vue.use(VueRouter);
Vue.use(VuexFlash, {
mixin: true,
template: require('./components/errors/Flash.template')
});
Vue.use(vuexI18n.plugin, store); Vue.use(vuexI18n.plugin, store);
Vue.use(VuexFlash, { mixin: true, template: require('./components/errors/Flash.template') });
Vue.i18n.add('en', Locales.en); Vue.i18n.add('en', Locales.en);
Vue.i18n.set('en'); Vue.i18n.set('en');
@ -45,38 +34,21 @@ Vue.i18n.set('en');
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
routes: [ routes: [
{ { name: 'login', path: '/auth/login', component: Login },
name: 'login', { name: 'forgot-password', path: '/auth/password', component: Login },
path: '/auth/login', { name: 'checkpoint', path: '/checkpoint', component: Login },
component: Login,
},
{
name: 'forgot-password',
path: '/auth/password',
component: Login,
},
{
name: 'checkpoint',
path: '/checkpoint',
component: Login,
},
{ {
name: 'reset-password', name: 'reset-password',
path: '/auth/password/reset/:token', path: '/auth/password/reset/:token',
component: ResetPassword, component: ResetPassword,
props: function (route) { props: function (route) {
return { return { token: route.params.token, email: route.query.email || '' };
token: route.params.token, }
email: route.query.email || '', },
} { path: '*', redirect: '/auth/login' }
},
}
] ]
}); });
require('./bootstrap'); require('./bootstrap');
const app = new Vue({ const app = new Vue({ store, router }).$mount('#pterodactyl');
store,
router,
}).$mount('#pterodactyl');

View file

@ -27,6 +27,9 @@ Route::group(['middleware' => 'guest'], function () {
// the forgot password routes to acquire a token (or after an account // the forgot password routes to acquire a token (or after an account
// is created). // is created).
Route::post('/password/reset', 'ResetPasswordController')->name('auth.reset-password')->middleware('recaptcha'); Route::post('/password/reset', 'ResetPasswordController')->name('auth.reset-password')->middleware('recaptcha');
// Catch any other combinations of routes and pass them off to the Vuejs component.
Route::fallback('LoginController@index');
}); });
/* /*