append(':') ->append(AllowExternalProfileManagement::class) ->__toString(); $this->middleware(EnabledOnlyOnLocalhost::class); $this->middleware($isExternalProfileManagementAllowed); } /** * This is the redirect URL which is set in the external provider. * * @param Request $request * @return RedirectResponse|JsonResponse */ public function index(Request $request): RedirectResponse|JsonResponse { $validated = array_merge( $request->all(), [ExternalProfile::ATTRIBUTE_USER => Auth::id()] ); $action = new ExternalTokenCallbackAction(); $profile = $action->store($validated); $profile->startSyncEntriesJob(); // https://animethemes.moe/external/{mal|anilist}/{profile_name} $clientUrl = Str::of(Config::get('wiki.external_profile')) ->append('/') ->append(Str::lower($profile->site->name)) ->append('/') ->append($profile->getName()) ->__toString(); return Redirect::to($clientUrl); } }