From fa05a80818d77860bfc10e582dcbf27eebe0b0ef Mon Sep 17 00:00:00 2001 From: Kevin ANATOLE Date: Sun, 26 Apr 2020 23:32:27 +0100 Subject: [PATCH] exercise_tracker_api-1 User Authentication --- app/User.php | 2 +- routes/api.php | 5 +++++ tests/Feature/ExampleTest.php | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/User.php b/app/User.php index e79dab7..f630706 100644 --- a/app/User.php +++ b/app/User.php @@ -16,7 +16,7 @@ class User extends Authenticatable * @var array */ protected $fillable = [ - 'name', 'email', 'password', + 'username', 'email', 'password', ]; /** diff --git a/routes/api.php b/routes/api.php index 9af0251..4074ace 100644 --- a/routes/api.php +++ b/routes/api.php @@ -21,3 +21,8 @@ Route::middleware('auth:api')->get('/user', function (Request $request) { Route::prefix('exercises')->group(function () { Route::get('', 'ExerciseController@index'); }); + +Route::prefix('auth')->group(function() { + Route::post('register', 'UserController@register'); + Route::post('login', 'UserController@login'); +}); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index cdb5111..405aea2 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -15,7 +15,6 @@ class ExampleTest extends TestCase public function testBasicTest() { $response = $this->get('/'); - $response->assertStatus(200); } }