NOW MANAGED ON CODEBERG
Updated okta config keys, made SVG fully vector
Dan Brown90bf13c1ab06
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.phpindex 0fa005e1f..5a7a5e971 100644--- a/app/Http/Controllers/Auth/RegisterController.php+++ b/app/Http/Controllers/Auth/RegisterController.php@@ -250,15 +250,27 @@ class RegisterController extends Controller/*** The callback for social login services.* @param $socialDriver+ * @param Request $request* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector* @throws SocialSignInException+ * @throws UserRegistrationException+ * @throws \BookStack\Exceptions\SocialDriverNotConfigured+ * @throws ConfirmationEmailException*/- public function socialCallback($socialDriver)+ public function socialCallback($socialDriver, Request $request){if (!session()->has('social-callback')) {throw new SocialSignInException(trans('errors.social_no_action_defined'), '/login');}+ // Check request for error information+ if ($request->has('error') && $request->has('error_description')) {+ throw new SocialSignInException(trans('errors.social_login_bad_response', [+ 'socialAccount' => $socialDriver,+ 'error' => $request->get('error_description'),+ ]), '/login');+ }+$action = session()->pull('social-callback');if ($action == 'login') return $this->socialAuthService->handleLoginCallback($socialDriver);if ($action == 'register') return $this->socialRegisterCallback($socialDriver);@@ -279,7 +291,9 @@ class RegisterController extends Controller* Register a new user after a registration callback.* @param $socialDriver* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector+ * @throws ConfirmationEmailException* @throws UserRegistrationException+ * @throws \BookStack\Exceptions\SocialDriverNotConfigured*/protected function socialRegisterCallback($socialDriver){diff --git a/app/Services/SocialAuthService.php b/app/Services/SocialAuthService.phpindex 6286a6014..d52464539 100644--- a/app/Services/SocialAuthService.php+++ b/app/Services/SocialAuthService.php@@ -1,5 +1,7 @@<?php namespace BookStack\Services;+use BookStack\Http\Requests\Request;+use GuzzleHttp\Exception\ClientException;use Laravel\Socialite\Contracts\Factory as Socialite;use BookStack\Exceptions\SocialDriverNotConfigured;use BookStack\Exceptions\SocialSignInException;@@ -91,7 +93,6 @@ class SocialAuthServicepublic function handleLoginCallback($socialDriver){$driver = $this->validateDriver($socialDriver);-// Get user details from social driver$socialUser = $this->socialite->driver($driver)->user();$socialId = $socialUser->getId();@@ -135,7 +136,7 @@ class SocialAuthService$message .= trans('errors.social_account_register_instructions', ['socialAccount' => title_case($socialDriver)]);}- throw new SocialSignInException($message . '.', '/login');+ throw new SocialSignInException($message, '/login');}/**diff --git a/config/services.php b/config/services.phpindex 514720d72..ba9be69de 100644--- a/config/services.php+++ b/config/services.php@@ -81,8 +81,8 @@ return [],'okta' => [- 'client_id' => env('OKTA_KEY'),- 'client_secret' => env('OKTA_SECRET'),+ 'client_id' => env('OKTA_APP_ID'),+ 'client_secret' => env('OKTA_APP_SECRET'),'redirect' => env('APP_URL') . '/login/service/okta/callback','base_url' => env('OKTA_BASE_URL'),'name' => 'Okta',diff --git a/resources/assets/icons/okta.svg b/resources/assets/icons/okta.svgindex 3ae0d63a3..b5f3b1d3f 100644--- a/resources/assets/icons/okta.svg+++ b/resources/assets/icons/okta.svg@@ -1 +1 @@-<svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><use id="image0" xlink:href="#_Image1" x="0" y="0" width="64px" height="64px"/><defs><image id="_Image1" width="24px" height="24px" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAA7EAAAOxAGVKw4bAAACU0lEQVRIiaWVTUiUURSGn3PnGyXDrAjaVEIlGG2ElhHjT4RR6aZFtGgR1KaNFBjliJg/lT9tohbtWlvQD4SLUMehVhFBm3IpQYlZljSOOXNPixl/596Z0d7VcJ7zvufeb+79PiGfrj8vI7w9jlAJVABBlvwFZrH2HWKa6Y6kfBHirEbHqhAZBvbnXcCK3qC2ie66H+uByWltj7UiMrGBcICjiJkhOnYm/4CO+BPg7gaC10rkBdGxm2tKy7/ax6+BDmw6fLVU6+muHV0Z0Bbfi7GThWyAzXpyH+162YUt9JxIZhqNfZWnNY3qcVTLmTQBidkAayuw6SvZoW5JyYPMDqIjO5BQzr+f1QTjI9XEOt1BrcNbKS37Clru5F0RMUjooXflU78OecMB+hr/YNV/2m68bjZAgxOqvcijJus1L6kn8h2Vp04WhPsM4Nqeouo2OWVbPKDCACUOsIglWXS+6m8PKTW4T4Igxv0acct3bNUACw4QBrYVH292esi8AX46kXCn6AFi3nrItMHqffeq5BJtowcLhnfEm1G728kSiUZDYu6e12zMZ6KxGi9vj53C2mceahk8+U2yjUPAWW+Q6geUcximsBiwBzChIaDS64FWuiL9mS9UKnWeIPAPEKlB+JTZFUAoTy4ASRJzA8vt3G5YRMyRQq4iZUmn9zF4WlcGANw69p5QcOE/w9PAYXrrp5cKuZcpOl6F6MTm4nUXvbUzq0vu23r1paGsvB+RFgp/XJJAJ10R570p/DpoG6lGQo8R9gCl2eo8qh9RvUxP3Zd89n+rAbY6AaOFBwAAAABJRU5ErkJggg=="/></defs></svg>\ No newline at end of file+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm-.035 5.537a6.427 6.427 0 0 1 6.428 6.428 6.427 6.427 0 0 1-6.428 6.428 6.427 6.427 0 0 1-6.428-6.428 6.427 6.427 0 0 1 6.428-6.428z" fill="#007dc1"/></svg>\ No newline at end of filediff --git a/resources/lang/en/errors.php b/resources/lang/en/errors.phpindex 572bec42b..18ed63c60 100644--- a/resources/lang/en/errors.php+++ b/resources/lang/en/errors.php@@ -20,6 +20,7 @@ return ['ldap_extension_not_installed' => 'LDAP PHP extension not installed','ldap_cannot_connect' => 'Cannot connect to ldap server, Initial connection failed','social_no_action_defined' => 'No action defined',+ 'social_login_bad_response' => "Error received during :socialAccount login: \n:error",'social_account_in_use' => 'This :socialAccount account is already in use, Try logging in via the :socialAccount option.','social_account_email_in_use' => 'The email :email is already in use. If you already have an account you can connect your :socialAccount account from your profile settings.','social_account_existing' => 'This :socialAccount is already attached to your profile.',