registerPolicies(); // Thêm cấu hình hỗ trợ password grant $this->app->afterResolving(AuthorizationServer::class, function ($server) { $grant = new PasswordGrant( app(UserRepository::class), app(RefreshTokenRepository::class) ); $grant->setRefreshTokenTTL(new DateInterval('P1M')); // Thời gian sống refresh token: 1 tháng $server->enableGrantType($grant, new DateInterval('PT1H')); // Access token sống 1 giờ }); } }