diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php index ea5071cf..0ca532ac 100644 --- a/app/Http/Resources/UserResource.php +++ b/app/Http/Resources/UserResource.php @@ -50,7 +50,6 @@ public function toArray(Request $request): array 'timezone' => $this->resource->getAttribute('timezone'), 'language' => $this->resource->getAttribute('language'), 'is_admin' => $this->resource->isAdmin(), - 'github_login_enabled' => $this->resource->canLoginWithGithub(), 'weekly_summary_enabled' => $this->resource->isOptedInForWeeklySummary(), ], 'backup_tasks' => [ diff --git a/app/Models/User.php b/app/Models/User.php index 2aa666ca..c2b3d226 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -43,7 +43,6 @@ class User extends Authenticatable implements TwoFactorAuthenticatable 'email', 'password', 'timezone', - 'github_id', 'preferred_backup_destination_id', 'language', 'gravatar_email', @@ -170,14 +169,6 @@ public function backupTasklogCountToday(): int })->whereDate('created_at', today()->timezone($this->timezone ?? 'UTC'))->count(); } - /** - * Check if the user can log in with GitHub. - */ - public function canLoginWithGithub(): bool - { - return $this->github_id !== null; - } - /** * Determine if the user is opted in to receive weekly summaries. */ diff --git a/tests/Feature/Profile/Api/UserAPITest.php b/tests/Feature/Profile/Api/UserAPITest.php index a81f7a3f..0279e0d6 100644 --- a/tests/Feature/Profile/Api/UserAPITest.php +++ b/tests/Feature/Profile/Api/UserAPITest.php @@ -50,7 +50,6 @@ 'timezone', 'language', 'is_admin', - 'github_login_enabled', 'weekly_summary_enabled', ], 'backup_tasks' => [ diff --git a/tests/Unit/Models/UserTest.php b/tests/Unit/Models/UserTest.php index 5c4bda81..cfe02610 100644 --- a/tests/Unit/Models/UserTest.php +++ b/tests/Unit/Models/UserTest.php @@ -140,20 +140,6 @@ $this->assertEquals(0, $user->backupTaskLogCountToday()); }); -test('returns true if can login with github', function (): void { - - $user = User::factory()->create(['github_id' => 1]); - - $this->assertTrue($user->canLoginWithGithub()); -}); - -test('returns false if can not login with github', function (): void { - - $user = User::factory()->create(); - - $this->assertFalse($user->canLoginWithGithub()); -}); - test('returns only the users that have opted in for backup task summaries', function (): void { $userOne = User::factory()->receivesWeeklySummaries()->create(); $userTwo = User::factory()->doesNotReceiveWeeklySummaries()->create();