diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 5d7c8dcf1382..1a7de3a929a8 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -46,6 +46,8 @@ use Laravel\Socialite\Facades\Socialite; use PragmaRX\Google2FA\Google2FA; use Turbo124\Beacon\Facades\LightLogs; use Microsoft\Graph\Model; +use Illuminate\Support\Facades\Http; + class LoginController extends BaseController { @@ -336,7 +338,20 @@ class LoginController extends BaseController } elseif (request()->input('provider') == 'apple') { if (request()->has('token') || request()->has('auth_code')) { $token = request()->has('token') ? request()->input('token') : request()->input('auth_code'); - return $this->handleSocialiteLogin('apple', $token); + + + +$response = Http::post('https://appleid.apple.com/auth/token', [ + 'grant_type' => 'authorization_code', + 'code' => $token, + 'redirect_uri' => config('ninja.ninja_apple_redirect_url'), + 'client_id' => config('ninja.ninja_apple_client_id'), + 'client_secret' => config('ninja.ninja_apple_client_secret'), + ]); + +nlog($response); + + return $this->handleSocialiteLogin('apple', $response); } else { $message = 'Token is missing for the apple login'; } diff --git a/config/ninja.php b/config/ninja.php index 2e9f248ca856..f2b7fecdc109 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -194,5 +194,8 @@ return [ 'ninja_apple_bundle_id' => env('APPLE_BUNDLE_ID', false), 'ninja_apple_issuer_id' => env('APPLE_ISSUER_ID', false), 'react_app_enabled' => env('REACT_APP_ENABLED', false), + 'ninja_apple_client_id' => env('APPLE_CLIENT_ID', false), + 'ninja_apple_client_secret' => env('APPLE_CLIENT_SECRET',false), + 'ninja_apple_redirect_url' => env('APPLE_REDIRECT_URI',false), ]; diff --git a/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php b/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php index 483ca203682b..630f4ccc9e28 100644 --- a/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php @@ -39,6 +39,11 @@ {{ ctrans('texts.invoice_number') }} + + + {{ ctrans('texts.po_number') }} + + {{ ctrans('texts.invoice_date') }} @@ -78,6 +83,9 @@ {{ $invoice->number }} + + {{ $invoice->po_number }} + {{ $invoice->translateDate($invoice->date, $invoice->client->date_format(), $invoice->client->locale()) }}