v1.0.11: Standalone multi-instance OAuth callback routing, DB user pre-sync, and externalAuthToken redirect loop fix (no bridge.js needed)

This commit is contained in:
Enes Yakıştır
2026-10-03 11:00:14 +03:00
parent 8e8170a8dc
commit 717573aa9d
3 changed files with 111 additions and 30 deletions
+8 -3
View File
@@ -12,9 +12,10 @@ async function register({ registerHook, peertubeHelpers }) {
var isLoginUrl = window.location.pathname.includes('/login');
var isLocal = window.location.search.includes('local=true');
var isError = window.location.search.includes('externalAuthError');
var isExternalToken = window.location.search.includes('externalAuthToken');
// If user directly visits /login without local override or error, forward to YakNet SSO
if (isLoginUrl && !isLocal && !isError) {
// CRITICAL: Never intercept /login when PeerTube is completing the externalAuthToken handshake!
if (isLoginUrl && !isLocal && !isError && !isExternalToken) {
window.location.replace('/plugins/auth-yaknet/router/auth');
return;
}
@@ -28,7 +29,11 @@ async function register({ registerHook, peertubeHelpers }) {
var isLoginBtn = el.closest(
'my-login-link, .login-button, a[href*="/login"]:not(#yaktube-show-admin-login), a[aria-label*="Giriş"], a[title*="Giriş"], a[title*="login"], a[aria-label*="login"]'
);
if (isLoginBtn && !window.location.search.includes('local=true')) {
if (
isLoginBtn &&
!window.location.search.includes('local=true') &&
!window.location.search.includes('externalAuthToken')
) {
e.preventDefault();
e.stopPropagation();
window.location.href = '/plugins/auth-yaknet/router/auth';