Merge pull request #771 from shocknet/fix-url

fix url
This commit is contained in:
Justin (shocknet) 2024-10-17 12:21:54 -04:00 committed by GitHub
commit 987970ab95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 5 deletions

View file

@ -478,7 +478,7 @@ The nostr server will send back a message response, and inside the body there wi
- GetNPubLinkingState
- auth type: __App__
- http method: __post__
- http route: __/api/app/user/npub/token__
- http route: __/api/app/user/npub/state__
- input: [GetNPubLinking](#GetNPubLinking)
- output: [NPubLinking](#NPubLinking)

View file

@ -840,7 +840,7 @@ func NewClient(params ClientParams) *Client {
if err != nil {
return nil, err
}
finalRoute := "/api/app/user/npub/token"
finalRoute := "/api/app/user/npub/state"
body, err := json.Marshal(req)
if err != nil {
return nil, err

View file

@ -879,7 +879,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.GetNPubLinkingState) throw new Error('method: GetNPubLinkingState is not implemented')
app.post('/api/app/user/npub/token', async (req, res) => {
app.post('/api/app/user/npub/state', async (req, res) => {
const info: Types.RequestInfo = { rpcName: 'GetNPubLinkingState', batch: false, nostr: false, batchSize: 0}
const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n }
let authCtx: Types.AuthContext = {}

View file

@ -391,7 +391,7 @@ export default (params: ClientParams) => ({
GetNPubLinkingState: async (request: Types.GetNPubLinking): Promise<ResultError | ({ status: 'OK' }& Types.NPubLinking)> => {
const auth = await params.retrieveAppAuth()
if (auth === null) throw new Error('retrieveAppAuth() returned null')
let finalRoute = '/api/app/user/npub/token'
let finalRoute = '/api/app/user/npub/state'
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {