Boy132 4ec9171017
OAuth improvements (#903)
* 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
2025-01-15 18:29:06 +01:00

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);
}
}