diff --git a/app/Http/Controllers/Api/LogInController.php b/app/Http/Controllers/Api/LogInController.php new file mode 100644 index 00000000..2afb3f49 --- /dev/null +++ b/app/Http/Controllers/Api/LogInController.php @@ -0,0 +1,38 @@ +validate([ + 'email' => ['required'], + 'password' => ['required'], + ]); + + if ( + Auth::attempt([ + 'email' => $request->input('email'), + 'password' => $request->input('password'), + ]) + ) { + // LOG ATTEMPT? + + return response() + ->json([ + 'token' => 'TOKEN_GOES_HERE', + ]); + } else { + // LOG ATTEMPT? + + return response() + ->json(['error' => 'UNABLE_TO_LOG_IN']); + } + } +} diff --git a/resources/assets/js/prototype/app.js b/resources/assets/js/prototype/app.js index 68babdc9..ceac3fdb 100644 --- a/resources/assets/js/prototype/app.js +++ b/resources/assets/js/prototype/app.js @@ -5,6 +5,7 @@ import App from './components/App.vue'; import Login from './screens/Login.vue'; import Register from './screens/Register.vue'; +import Dashboard from './screens/Dashboard.vue'; Vue.use(VueRouter); @@ -17,6 +18,10 @@ const routes = [ path: '/prototype/register', name: 'register', component: Register, + }, { + path: '/prototype/dashboard', + name: 'dashboard', + component: Dashboard, }, ]; diff --git a/resources/assets/js/prototype/screens/Dashboard.vue b/resources/assets/js/prototype/screens/Dashboard.vue new file mode 100644 index 00000000..4c14c6f3 --- /dev/null +++ b/resources/assets/js/prototype/screens/Dashboard.vue @@ -0,0 +1,11 @@ + + + diff --git a/resources/assets/js/prototype/screens/Login.vue b/resources/assets/js/prototype/screens/Login.vue index 0e5370d5..cd54280b 100644 --- a/resources/assets/js/prototype/screens/Login.vue +++ b/resources/assets/js/prototype/screens/Login.vue @@ -1,5 +1,30 @@