Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pubkey for auth #9

Merged
merged 24 commits into from
Apr 29, 2024
Merged

Support pubkey for auth #9

merged 24 commits into from
Apr 29, 2024

Conversation

bob2402
Copy link
Collaborator

@bob2402 bob2402 commented Apr 26, 2024

No description provided.

Copy link
Owner

@BlowaterNostr BlowaterNostr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address all comments before proceeding

main.tsx Outdated
}
}
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to check the validity of the public key

main.tsx Outdated
@@ -154,6 +163,12 @@ async (req: Request, info: Deno.ServeHandlerInfo) => {
console.log(info.remoteAddr);

const { pathname, protocol } = new URL(req.url);
if (pathname === "/api/auth/login") {
const auth = req.headers.get("authorization");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to validate it

main.tsx Outdated
const cookie = req.headers.get("cookie");
const token = cookie?.split(";").find((c) => c.includes("token"))?.split("=")[1].split(
" ",
)[1];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not readable at all.
See https://deno.land/std@0.148.0/http/mod.ts?s=getCookies

Copy link
Owner

@BlowaterNostr BlowaterNostr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. use PublicKey class in relay information
  2. only one admin public key
  3. remove password
  4. use POST in frontend to login
  5. simplify verifyToken
  6. modify nip7 login button to show "logged-in state"

@BlowaterNostr BlowaterNostr merged commit c9fe98c into BlowaterNostr:main Apr 29, 2024
1 check passed
BlowaterNostr added a commit that referenced this pull request Apr 30, 2024
implement NIP-9 (#7)

Replaceable event (#8)

Support pubkey for auth (#9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants