mirror of
https://github.com/koel/koel
synced 2024-12-19 09:03:07 +00:00
17 lines
449 B
PHP
17 lines
449 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\User;
|
|
use App\Services\AuthenticationService;
|
|
use Illuminate\Contracts\Auth\Authenticatable;
|
|
|
|
class GetOneTimeTokenController extends Controller
|
|
{
|
|
/** @param User $user */
|
|
public function __invoke(AuthenticationService $auth, Authenticatable $user)
|
|
{
|
|
return response()->json(['token' => $auth->generateOneTimeToken($user)]);
|
|
}
|
|
}
|