Added an button to connect the oauth providers from WebUI

This commit is contained in:
Jan Böhmer 2023-07-16 03:18:33 +02:00
parent c203de082e
commit f7648e3311
6 changed files with 28 additions and 4 deletions

View file

@ -74,6 +74,16 @@ final class OAuthTokenManager
return $this->entityManager->getRepository(OAuthToken::class)->findOneBy(['name' => $app_name]);
}
/**
* Checks if a token for the given app name is existing
* @param string $app_name
* @return bool
*/
public function hasToken(string $app_name): bool
{
return $this->getToken($app_name) !== null;
}
/**
* This function refreshes the token for the given app name. The new token is saved to the database
* The app_name must be registered in the knpu_oauth2_client.yaml