Open hussu010 opened 2 years ago
Are we missing some fields according to https://docs.google.com/document/d/1lOmcPgQFz6w-4JzLIYC6Tytw0_xedlpnBtdBZN6-Bqw/edit?
Some other follow up questions:
/api/v1/users
: this is to create the user account right? perhaps /api/v1/users/create
might be a more suitable endpoint?Once we have the nonce, ask the user to sign the message Signing my leapchain nonce: NONCE.
account number
signed with the nonce
?cc @hussu010 @mrbusysky
Via keysign, also the backend should be verifying the signature, not the front end. @jamessspanggg the front end only handles the handshake method, and the post/get to backend. Plus the other stuff like storing data and so on in the local storage.
Are we missing some fields according to https://docs.google.com/document/d/1lOmcPgQFz6w-4JzLIYC6Tytw0_xedlpnBtdBZN6-Bqw/edit?
We decided to have the API independent of anything else and later connect the discord bot to API if necessary.
POST to /api/v1/users: this is to create the user account right? perhaps /api/v1/users/create might be a more suitable endpoint?
Sure I'll update the naming in the next release.
How are we performing the signing? is it via the https://thenewboston-developers.github.io/thenewboston-js/account.html#creating-signatures here? Also just to clarify, the signature is basically the account number signed with the nonce?
Exactly. Here we will be using the Keysign for the signature. If we were using the library it'd be:
const account = new Account();
account.createSignature("Signing my leapchain nonce: 234323");
Let me know if anything is unclear. cc: @mrbusysky @jamessspanggg
WIP Prototype: https://github.com/LeapChain/Website/pull/18
This is semi done. But it will need some cleanup
Connect Wallet
.accountNumber
./api/v1/users/create
to get the nonce of the user.Body of the request:
Response:
Signing my leapchain nonce: NONCE
.api/v1/auth
endpoint with the body:accessToken
for JWT-based authentication.PS: We are not using the JWT yet.