Adding some standard OpenID Connect providers (Google, Facebook) (WIP):

* refactoring, to allow several OIDC singletons
* settings for google and facebook
* backend code
This commit is contained in:
John Livingston
2024-04-22 13:03:31 +02:00
parent 4bc2d4fd51
commit 024186ba2c
16 changed files with 341 additions and 142 deletions

View File

@ -21,8 +21,8 @@ async function initAuthApiRouter (options: RegisterServerOptions, router: Router
const token = req.header('X-Peertube-Plugin-Livechat-External-Auth-OIDC-Token')
if (token) {
try {
const oidc = ExternalAuthOIDC.singleton()
if (await oidc.isOk()) {
const oidc = ExternalAuthOIDC.singletonForToken(token)
if (oidc && await oidc.isOk()) {
const unserializedToken = await oidc.unserializeToken(token)
if (unserializedToken) {
res.status(200).json({