mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 03:08:51 +02:00
Added an button to connect the oauth providers from WebUI
This commit is contained in:
parent
c203de082e
commit
f7648e3311
6 changed files with 28 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue