mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 01:44:45 +02:00

* rework oauth provider creation & lodaing * add separate setup form * use wizard for setup * add provider class for discord * cleanup and fixes * don't throw exception when creating duplicate provider * update profile and login pages * did not mean to remove the whole else, oops * use import
37 lines
836 B
PHP
37 lines
836 B
PHP
<?php
|
|
|
|
namespace App\Extensions\OAuth\Providers;
|
|
|
|
final class CommonProvider extends OAuthProvider
|
|
{
|
|
protected function __construct(private string $id, private ?string $providerClass, private ?string $icon, private ?string $hexColor)
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public function getId(): string
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getProviderClass(): ?string
|
|
{
|
|
return $this->providerClass;
|
|
}
|
|
|
|
public function getIcon(): ?string
|
|
{
|
|
return $this->icon;
|
|
}
|
|
|
|
public function getHexColor(): ?string
|
|
{
|
|
return $this->hexColor;
|
|
}
|
|
|
|
public static function register(string $id, ?string $providerClass = null, ?string $icon = null, ?string $hexColor = null): static
|
|
{
|
|
return new self($id, $providerClass, $icon, $hexColor);
|
|
}
|
|
}
|