middleware(EnabledOnlyOnLocalhost::class); $this->middleware(EnsureFeaturesAreActive::using(AllowExternalProfileManagement::class)); } /** * This is the redirect URL which is set in the external provider. */ public function index(ExternalTokenCallbackRequest $request): RedirectResponse { $validated = array_merge( $request->validated(), [ExternalProfile::ATTRIBUTE_USER => Auth::id()] ); $action = new ExternalTokenCallbackAction(); $profile = $action->store($validated); $profile->dispatchSyncJob(); return $profile->getClientUrl()->redirect(); } }