robosats api in node/nuxt 3 app invalid token #2019
-
I'm trying to integrate robosats api in a nuxt3 application but I always get:
if I include all the required headers props Or
If I only include the token (that let me assume that the token is actually correct). A typical token that I generate is:
Here it's a minimal repo to reproduce: https://github.com/learntheropes/robosats-nuxt3 The most relevant part of my code, that tries to replicate what the frontend does in this official repo, is:
What could be the issue? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 7 replies
-
This error
Means that you are not sending the PGP keys on headers with the first request of one specific robot to one specific coordinator (coordinators are totally independent from from each other and you should treat them like separate services) This one
Means that you are sending somehow a wrongly formated robot token. You can find how tokens are created in client's code https://github.com/RoboSats/robosats/blob/main/frontend/src/utils/token.ts#L2 Just a heads up. We are planing to stop using PGP keys in favour of nostr pub keys for v0.8.0 robosats/robosats/middleware.py Line 53 in a034f4a |
Beta Was this translation helpful? Give feedback.
-
What I don't understand is that when I send the token only, it is accepted (because the error message is not about the wrong token but about the missing keys) while when I send the complete header including the keys, the coordinator complains about the wrong token. So, in practice, I'm not able to understand if my code to generate the tokens is correct. |
Beta Was this translation helpful? Give feedback.
-
So I updated my repo accordingly to the code you shared with:
But the issue persists. |
Beta Was this translation helpful? Give feedback.
-
No way, I tested tens of solutions and I pushed the one closest to yours but the problem is still the same. If you can help me looking in my minimal repo, otherwise I'm forced to give up :( |
Beta Was this translation helpful? Give feedback.
-
I'm creating this project https://github.com/p2payserver where users can pay to btcpay server using fiat that is exchanged under the hood to btc on robosats, peach bitcoin etc. But with this blocker, I will not be able to integrate robosats. Two days trying, h24, me and chatgpt https://chatgpt.com/share/6858a280-1b40-8013-917f-1180885ff3e6 |
Beta Was this translation helpful? Give feedback.
-
The problem is probably on the pgp keys.
|
Beta Was this translation helpful? Give feedback.
-
Fixed! Finally |
Beta Was this translation helpful? Give feedback.
-
Damn, I realize only now that robosats requires a bond from the buyer. So it is not usable in my app, that is meant for no-coiners to pay on btcpay server. But at least I learn a lot about robosats. |
Beta Was this translation helpful? Give feedback.
This error
Means that you are not sending the PGP keys on headers with the first request of one specific robot to one specific coordinator (coordinators are totally independent from from each other and you should treat them like separate services)
This one
Means that you are sending somehow a wrongly formated robot token. You can find how tokens are created in client's code https://github.com/RoboSats/robos…