fix: use iframe for nsecbunker auth
All checks were successful
Release / build_and_release (push) Successful in 43s

This commit is contained in:
Sabir Hassan 2024-03-19 10:46:27 +05:00
parent 7c3c061b88
commit c99a2a81c2

View File

@ -31,6 +31,7 @@ export const Login = () => {
const [isLoading, setIsLoading] = useState(false)
const [loadingSpinnerDesc, setLoadingSpinnerDesc] = useState('')
const [inputValue, setInputValue] = useState('')
const [authUrl, setAuthUrl] = useState<string>()
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 (
<iframe
title='Nsecbunker auth'
src={authUrl}
width='100%'
height='500px'
/>
)
}
return (
<>
{isLoading && <LoadingSpinner desc={loadingSpinnerDesc} />}