Got working with nostr-login
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
nostr-login/
|
||||||
1
nostr-login
Submodule
1
nostr-login
Submodule
Submodule nostr-login added at a679422d07
@@ -2,9 +2,6 @@
|
|||||||
"folders": [
|
"folders": [
|
||||||
{
|
{
|
||||||
"path": "."
|
"path": "."
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "../nostr-login"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|||||||
4
upload.sh
Executable file
4
upload.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rsync -avz ./app.js ubuntu@laantungir.net:~/nostr-oidc-bridge/app.js
|
||||||
|
rsync -avz ./views/login.ejs ubuntu@laantungir.net:~/nostr-oidc-bridge/views/
|
||||||
@@ -3,7 +3,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Nostr Login - OIDC Bridge v2.2</title>
|
<title>OIDC Bridge v2.4</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background: black
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="login-container">
|
<div id="login-container">
|
||||||
@@ -19,22 +25,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<!-- Version header -->
|
|
||||||
<div style="text-align: center; margin: 10px 0; padding: 8px; background: #e3f2fd; border: 1px solid #2196f3; border-radius: 4px; font-weight: bold; color: #1976d2;">
|
|
||||||
🚀 Nostr OIDC Bridge v2.2 - Fixed npub scope + relay update
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Target div for nostr-login widget -->
|
<!-- Target div for nostr-login widget -->
|
||||||
<div id="nostr-login"></div>
|
<div id="nostr-login"></div>
|
||||||
|
|
||||||
<!-- Version info -->
|
<!-- Version info -->
|
||||||
<div style="position: fixed; bottom: 10px; right: 10px; font-size: 14px; color: #333; background: rgba(255,255,255,0.95); padding: 6px 12px; border-radius: 6px; border: 1px solid #ddd; font-weight: bold;">
|
|
||||||
v2.2 - Fixed npub scope + relay update
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Load your hosted nostr-login with full permissions -->
|
<!-- Load your hosted nostr-login with custom laan theme configuration -->
|
||||||
<script src='https://laantungir.net/nostr-login/unpkg.js'></script>
|
<script src='https://laantungir.net/nostr-login/unpkg.js'
|
||||||
|
data-theme='laan'
|
||||||
|
data-start-screen='welcome'
|
||||||
|
data-no-banner='true'></script>
|
||||||
|
|
||||||
<!-- Import nostr-tools for proper npub encoding -->
|
<!-- Import nostr-tools for proper npub encoding -->
|
||||||
<script type="module">
|
<script type="module">
|
||||||
@@ -46,35 +49,16 @@
|
|||||||
<script>
|
<script>
|
||||||
let isProcessing = false;
|
let isProcessing = false;
|
||||||
|
|
||||||
// Initialize nostr-login widget
|
// Widget initialization is now handled automatically by the script data attributes
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
console.log('Nostr-login widget will initialize automatically with laan theme and immediate login display');
|
||||||
console.log('Initializing nostr-login widget...');
|
|
||||||
|
// Auto-launch the login modal immediately when page loads
|
||||||
// Create nostr-login options
|
window.addEventListener('load', () => {
|
||||||
const nostrLoginOptions = {
|
// Small delay to ensure nostr-login widget is fully initialized
|
||||||
bunkers: 'all',
|
setTimeout(() => {
|
||||||
methods: 'all',
|
console.log('Auto-launching nostr-login modal...');
|
||||||
noBanner: true,
|
document.dispatchEvent(new CustomEvent('nlLaunch', { detail: 'login' }));
|
||||||
startScreen: 'welcome-login',
|
}, 100);
|
||||||
theme: 'default'
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log('nostr-login options', nostrLoginOptions);
|
|
||||||
|
|
||||||
// Initialize the widget
|
|
||||||
if (window.NostrLogin) {
|
|
||||||
window.NostrLogin.init(nostrLoginOptions);
|
|
||||||
} else {
|
|
||||||
console.error('NostrLogin not found on window object');
|
|
||||||
|
|
||||||
// Fallback: try to initialize after a delay
|
|
||||||
setTimeout(() => {
|
|
||||||
if (window.NostrLogin) {
|
|
||||||
console.log('Retrying NostrLogin initialization...');
|
|
||||||
window.NostrLogin.init(nostrLoginOptions);
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Listen for nostr-login authentication events
|
// Listen for nostr-login authentication events
|
||||||
|
|||||||
Reference in New Issue
Block a user