rafaelwendel / phpsupabase

PHP Client to use Supabase
MIT License
187 stars 18 forks source link

$auth->getUser(); error #12

Closed bobtechinsider closed 1 year ago

bobtechinsider commented 1 year ago

Hi, when I try to use the following:

try{
    $data = $auth->getUser($bearerToken);
    print_r($data); // show all user data returned
  } catch(Exception $e){
    echo $auth->getError();
}   

I receive back an error:

Client error: GET https://*****.supabase.co/auth/v1/user resulted in a 401 Unauthorized response:

"Invalid JWT: unable to parse or verify signature, signature is invalid".

Do you probably know what the problem could be?

mblode commented 1 year ago

Hey @bobmolgui, do you remember what the solution was to this issue?

rafaelwendel commented 1 year ago

Hi @mblode

Check your credentials. Was the $bearerToken generated correctly?

bobtechinsider commented 1 year ago

For me, it was the packages. After I updated them, everything worked. What is your error or could you already fix it?