<?php

namespace App\Providers;

// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use App\Models\User;
use Illuminate\Auth\Notifications\ResetPassword;

class AuthServiceProvider extends ServiceProvider
{
    /**
     * The model to policy mappings for the application.
     *
     * @var array<class-string, class-string>
     */
    protected $policies = [
        //
    ];

    /**
     * Register any authentication / authorization services.
     */
    public function boot(): void
    {
        // $this->registerPolicies();

        // Passport::routes();

        // Passport::tokensExpireIn(now()->addDays(15));
        // Passport::refreshTokensExpireIn(now()->addDays(30));

        // Passport::client(function (Client $client) {
        //     $client->name('Your Client Name');
        //     $client->redirectUri('your-callback-url');
        //     $client->user();
        // });



        ResetPassword::createUrlUsing(function (User $user, string $token) {
            return env("FRONTEND_URL").'/reset-password?token='.$token.'&email='.$user->email;
            // return 'http://localhost:3000/reset-password?token='.$token.'&email='.$user->email;
        });
    }
}
