Skip to content

Commit

Permalink
fix: unmatch macaroon and preimage
Browse files Browse the repository at this point in the history
  • Loading branch information
studioTeaTwo committed Dec 18, 2023
1 parent cbaec6c commit 2c9af1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/lib/nostr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export async function getUserRelayList(nPubkey: string) {
if (user.profile.relays && user.profile.relays.length > 0) {
// assume kind:0
// the reason of string[]: https://github.com/nostr-dev-kit/ndk/blob/07dfd1a8b61acbbb93998fd591fd751760f99494/ndk/src/user/index.ts#L129
return user.profile.relays as unknown as string[];
if (!(typeof user.profile.relays === 'string')) {
return user.profile.relays as unknown as string[];
}
}
if (user.profile.nip05) {
const nip05 = await NDKUser.fromNip05(user.profile.nip05);
Expand Down
3 changes: 2 additions & 1 deletion src/lib/stores/l402.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export const authInProcess = {
return '';
}
const vals: AuthInProcess[] = JSON.parse(data);
return vals.find((val) => (val.slug = slug))?.macaroon;
const found = vals.find((val) => val.slug === slug);
return found ? found.macaroon : '';
},
set: (newval: AuthInProcess) => {
if (!browser) {
Expand Down

0 comments on commit 2c9af1e

Please sign in to comment.