feat: google login
CI / 🧪 Tests Laravel (push) Failing after 9s
CI / 🐳 Build & Push Images (push) Has been skipped

This commit is contained in:
2026-08-17 10:06:35 +02:00
parent c0688044e8
commit ddc80956a0
22 changed files with 1886 additions and 6 deletions
@@ -0,0 +1,36 @@
<?php
namespace App\Actions;
use App\Enums\SocialProvider;
use App\Models\User;
use App\Services\AppleOAuthTokenClient;
use Illuminate\Contracts\Encryption\DecryptException;
class RevokeSocialAuthorizations
{
public function __construct(private AppleOAuthTokenClient $appleOAuthTokenClient) {}
public function execute(User $user): void
{
$appleAccount = $user->socialAccounts()
->where('provider', SocialProvider::Apple)
->first();
if (! $appleAccount) {
return;
}
try {
$refreshToken = $appleAccount->provider_refresh_token;
} catch (DecryptException) {
abort(503, 'SOCIAL_REVOCATION_FAILED');
}
if (! is_string($refreshToken) || $refreshToken === '') {
abort(409, 'SOCIAL_REVOCATION_TOKEN_MISSING');
}
$this->appleOAuthTokenClient->revoke($refreshToken);
}
}