Skip to content

Commit b6e94d9

Browse files
committed
Code cleanup
1 parent 6d970a4 commit b6e94d9

File tree

3 files changed

+14
-41
lines changed

3 files changed

+14
-41
lines changed

app/Http/Controllers/Auth/LoginController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public function login(Request $request): JsonResponse
3535
$username = $request->input('user');
3636
$useColumn = $this->getField($username);
3737

38-
sleep(1);
39-
4038
if ($this->hasTooManyLoginAttempts($request)) {
4139
$this->fireLockoutEvent($request);
4240
$this->sendLockoutResponse($request);

resources/assets/pterodactyl/scripts/app.js

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,65 +18,37 @@ window.Ziggy = Ziggy;
1818

1919
Vue.use(Vuex);
2020

21-
const store = new Vuex.Store({
22-
plugins: [
23-
createFlashStore(),
24-
],
25-
});
21+
const store = new Vuex.Store({ plugins: [createFlashStore()] });
2622
const route = require('./../../../../vendor/tightenco/ziggy/src/js/route').default;
2723

2824
Vue.config.productionTip = false;
29-
Vue.mixin({
30-
methods: {
31-
route: route,
32-
},
33-
});
25+
Vue.mixin({ methods: { route } });
3426

3527
Vue.use(VueRouter);
36-
Vue.use(VuexFlash, {
37-
mixin: true,
38-
template: require('./components/errors/Flash.template')
39-
});
4028
Vue.use(vuexI18n.plugin, store);
29+
Vue.use(VuexFlash, { mixin: true, template: require('./components/errors/Flash.template') });
4130

4231
Vue.i18n.add('en', Locales.en);
4332
Vue.i18n.set('en');
4433

4534
const router = new VueRouter({
4635
mode: 'history',
4736
routes: [
48-
{
49-
name: 'login',
50-
path: '/auth/login',
51-
component: Login,
52-
},
53-
{
54-
name: 'forgot-password',
55-
path: '/auth/password',
56-
component: Login,
57-
},
58-
{
59-
name: 'checkpoint',
60-
path: '/checkpoint',
61-
component: Login,
62-
},
37+
{ name: 'login', path: '/auth/login', component: Login },
38+
{ name: 'forgot-password', path: '/auth/password', component: Login },
39+
{ name: 'checkpoint', path: '/checkpoint', component: Login },
6340
{
6441
name: 'reset-password',
6542
path: '/auth/password/reset/:token',
6643
component: ResetPassword,
6744
props: function (route) {
68-
return {
69-
token: route.params.token,
70-
email: route.query.email || '',
71-
}
72-
},
73-
}
45+
return { token: route.params.token, email: route.query.email || '' };
46+
}
47+
},
48+
{ path: '*', redirect: '/auth/login' }
7449
]
7550
});
7651

7752
require('./bootstrap');
7853

79-
const app = new Vue({
80-
store,
81-
router,
82-
}).$mount('#pterodactyl');
54+
const app = new Vue({ store, router }).$mount('#pterodactyl');

routes/auth.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
// the forgot password routes to acquire a token (or after an account
2828
// is created).
2929
Route::post('/password/reset', 'ResetPasswordController')->name('auth.reset-password')->middleware('recaptcha');
30+
31+
// Catch any other combinations of routes and pass them off to the Vuejs component.
32+
Route::fallback('LoginController@index');
3033
});
3134

3235
/*

0 commit comments

Comments
 (0)