diff --git a/peertube-plugin-auth-openid-connect/main.js b/peertube-plugin-auth-openid-connect/main.js index 8e2ad79..b736168 100644 --- a/peertube-plugin-auth-openid-connect/main.js +++ b/peertube-plugin-auth-openid-connect/main.js @@ -87,9 +87,9 @@ async function register ({ }) const router = getRouter() - router.use('/id-token-cb', (req, res) => handleCb(peertubeHelpers, settingsManager, req, res)) + router.use('/code-cb', (req, res) => handleCb(peertubeHelpers, settingsManager, req, res)) - store.redirectUrl = peertubeHelpers.config.getWebserverUrl() + '/plugins/auth-openid-connect/router/id-token-cb' + store.redirectUrl = peertubeHelpers.config.getWebserverUrl() + '/plugins/auth-openid-connect/router/code-cb' const secretKeyBuf = await getRandomBytes(16) store.secretKey = secretKeyBuf.toString('hex') @@ -161,9 +161,6 @@ async function loadSettingsAndCreateClient (registerExternalAuth, unregisterExte store.client = new issuer.Client(clientOptions) - // We already registered this external auth - if (store.userAuthenticated) return - const webserverUrl = config.getWebserverUrl() const result = registerExternalAuth({