Skip to content

Commit

Permalink
Generate API Token on admin login
Browse files Browse the repository at this point in the history
  • Loading branch information
ttimot24 committed Dec 15, 2024
1 parent c4e7733 commit d753bc1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Routing\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Str;

class LoginController extends Controller
{
Expand Down Expand Up @@ -66,7 +67,11 @@ public function showLoginForm()
]);
}


protected function authenticated(Request $request, $user)
{
$user->api_token = Str::random(60);
$user->save();
}

public function logout(Request $request)
{
Expand Down

0 comments on commit d753bc1

Please sign in to comment.