Skip to content

Commit 432795a

Browse files
committed
fix issues with login buttons
1 parent ac259b0 commit 432795a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

inventory-manager.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ <h1>Inventory Manager</h1>
651651
<!-- Login Section -->
652652
<div id="login-section" class="login-box">
653653
<h2>Authentication Required</h2>
654-
<button onclick="window.location.href='https://rotur.dev/auth'" class="login-btn">Login</button>
654+
<button class="login-btn">Login</button>
655655
<div id="login-error" class="error"></div>
656656
</div>
657657

@@ -836,6 +836,9 @@ <h2 id="single-item-name" class="single-item-name"></h2>
836836

837837
document.getElementById('logout-btn').addEventListener('click', handleLogout);
838838
document.getElementById('create-item-btn').addEventListener('click', createNewItem);
839+
document.getElementsByClassName('login-btn')[0].addEventListener('click', () => {
840+
window.location.href = 'https://auth.rotur.dev/login?redirect=' + encodeURIComponent(window.location.href);
841+
});
839842
});
840843

841844
async function validateAuthAndFetchUser(token) {

key-manager.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ <h1>Key Manager</h1>
350350
<!-- Login Section -->
351351
<div id="login-section" class="login-box">
352352
<h2>Authentication Required</h2>
353-
<button onclick="window.location.href='https://rotur.dev/auth'" class="login-btn">Login</button>
353+
<button class="login-btn">Login</button>
354354
<div id="login-error" class="error"></div>
355355
</div>
356356

@@ -558,7 +558,10 @@ <h4>Key Management</h4>
558558

559559
document.getElementById('logout-btn').addEventListener('click', handleLogout);
560560
document.getElementById('create-key-btn').addEventListener('click', createNewKey);
561-
561+
document.getElementsByClassName('login-btn')[0].addEventListener('click', () => {
562+
window.location.href = 'https://auth.rotur.dev/login?return_to=' + encodeURIComponent(window.location.href);
563+
});
564+
562565
// Add event listener for key type dropdown
563566
document.getElementById('new-key-type').addEventListener('change', function() {
564567
const subscriptionFields = document.getElementById('subscription-fields');

0 commit comments

Comments
 (0)