PHP code example of kyzegs / supabase-auth-bundle
1. Go to this page and download the library: Download kyzegs/supabase-auth-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kyzegs / supabase-auth-bundle example snippets
return [
// ...
Kyzegs\SupabaseAuthBundle\SupabaseAuthBundle::class => ['all' => true],
];
namespace App\Security;
use App\Repository\UserRepositoryInterface;
use Kyzegs\SupabaseAuthBundle\Contract\SupabaseUserResolverInterface;
use Symfony\Component\Security\Core\User\UserInterface;
final class SupabaseUserResolver implements SupabaseUserResolverInterface
{
public function __construct(private UserRepositoryInterface $users) {}
public function resolve(array $claims): ?UserInterface
{
return $this->users->find($claims['sub']);
}
}