From c99a2a81c265f601e2af00890132818d905d6133 Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Tue, 19 Mar 2024 10:46:27 +0500 Subject: [PATCH] fix: use iframe for nsecbunker auth --- src/pages/login/index.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index 741f661..63e4bc6 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -31,6 +31,7 @@ export const Login = () => { const [isLoading, setIsLoading] = useState(false) const [loadingSpinnerDesc, setLoadingSpinnerDesc] = useState('') const [inputValue, setInputValue] = useState('') + const [authUrl, setAuthUrl] = useState() const [isNostrExtensionAvailable, setIsNostrExtensionAvailable] = useState(false) @@ -175,7 +176,11 @@ export const Login = () => { setLoadingSpinnerDesc('Creating nsecbunker singer') await nostrController .createNsecBunkerSigner(pubkey) - .then(async () => { + .then(async (signer) => { + signer.on('authUrl', (url: string) => { + setAuthUrl(url) + }) + dispatch(updateLoginMethod(LoginMethods.nsecBunker)) dispatch(updateNsecbunkerPubkey(pubkey)) @@ -216,6 +221,17 @@ export const Login = () => { return } + if (authUrl) { + return ( +