-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
There was a problem hiding this 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
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- use
PublicKey
class in relay information - only one admin public key
- remove password
- use POST in frontend to login
- simplify
verifyToken
- modify nip7 login button to show "logged-in state"
No description provided.