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

createOrUpdateUser error Unauthorized #14

Open
tangmingzhi opened this issue Nov 1, 2024 · 0 comments
Open

createOrUpdateUser error Unauthorized #14

tangmingzhi opened this issue Nov 1, 2024 · 0 comments

Comments

@tangmingzhi
Copy link

tangmingzhi commented Nov 1, 2024

call method failed
public async createOrUpdateUser(
request: UpdateUserPayload,
signature: string
) {
const url = ${this.url}/user;
const response = await fetch(url, {
method: "PUT",
headers: {
"Content-Type": "application/json",
"X-Signed-Header": signature,
},
body: request.toString(),
});
if (!response.ok) {
throw new Error(createOrUpdateUser failed: ${response.statusText});
}
}

request log
X-Signed-Header:{"user_pubkey":"2rbL8qV2UaobpQFwAfwKGkcarFPdQLkPbzi5n35dDXu8","ciphersuite":"ed25519","contact_info":"","timestamp":1730264027}
body:
UzaXQJC9GvaWNvUiTRuBGZ1hRexqeh8PgoUZ3inym16VgFDFYHhG+/xjoOXmCTg5+Ol7btMZE0KUxc0EwgY5Bw==
An error occurred: Error: createOrUpdateUser failed: Unauthorized

what should to do ?

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

No branches or pull requests

1 participant