Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
feat: add auto-redirect-login setting with dynamic config synchronization (v1.0.7)
This commit is contained in:
@@ -1,3 +1,58 @@
|
||||
function registerClient({ registerHook, peertubeHelpers }) {
|
||||
// YakNet client script
|
||||
try {
|
||||
fetch('/plugins/peertube-plugin-auth-yaknet/router/status')
|
||||
.then(function (r) {
|
||||
return r.json();
|
||||
})
|
||||
.then(function (status) {
|
||||
if (!status || status.autoRedirectLogin === false) {
|
||||
return; // Auto redirect is disabled by administrator
|
||||
}
|
||||
|
||||
var isLoginUrl = window.location.pathname.includes('/login');
|
||||
var isLocal = window.location.search.includes('local=true');
|
||||
var isError = window.location.search.includes('externalAuthError');
|
||||
|
||||
// If user directly visits /login without local override or error, forward to YakNet SSO
|
||||
if (isLoginUrl && !isLocal && !isError) {
|
||||
window.location.replace('/plugins/peertube-plugin-auth-yaknet/router/auth');
|
||||
return;
|
||||
}
|
||||
|
||||
// Intercept clicks on login links/buttons
|
||||
document.addEventListener(
|
||||
'click',
|
||||
function (e) {
|
||||
var el = e.target;
|
||||
if (el && el.closest) {
|
||||
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')) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
window.location.href = '/plugins/peertube-plugin-auth-yaknet/router/auth';
|
||||
}
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
})
|
||||
.catch(function () {});
|
||||
|
||||
// Alt+A shortcut for local admin login bypass
|
||||
document.addEventListener('keydown', function (e) {
|
||||
if (e.altKey && (e.key === 'a' || e.key === 'A')) {
|
||||
if (!window.location.pathname.includes('/login')) {
|
||||
window.location.href = '/login?local=true';
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
console.warn('[YakNet SSO] Client init error:', err);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = { registerClient: registerClient };
|
||||
}
|
||||
Reference in New Issue
Block a user