some opportunistic refactors
This commit is contained in:
parent
371204785d
commit
2da553f4d6
1 changed files with 2 additions and 7 deletions
|
|
@ -4,14 +4,9 @@ const requestAndRespondLoginChallenge = async ({
|
||||||
onRejectedPubKeyCallback,
|
onRejectedPubKeyCallback,
|
||||||
onRejectedSignatureCallback,
|
onRejectedSignatureCallback,
|
||||||
}) => {
|
}) => {
|
||||||
onRejectedPubKeyCallback = () => {
|
|
||||||
document.querySelector('#rejected-nostr-nudges').style.display = 'block';
|
|
||||||
};
|
|
||||||
onRejectedSignatureCallback = onRejectedPubKeyCallback;
|
|
||||||
|
|
||||||
let challengeResponse;
|
let challengeResponse;
|
||||||
try {
|
try {
|
||||||
challengeResponse = await fetch('/api/login/nostr-challenge', {
|
challengeResponse = await fetch(constants.API_PATHS.loginNostrChallenge, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|
@ -49,7 +44,7 @@ const requestAndRespondLoginChallenge = async ({
|
||||||
|
|
||||||
let verifyResponse;
|
let verifyResponse;
|
||||||
try {
|
try {
|
||||||
verifyResponse = await fetch('/api/login/nostr-verify', {
|
verifyResponse = await fetch(constants.API_PATHS.loginNostrVerify, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify(signedEvent),
|
body: JSON.stringify(signedEvent),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue