Closed cklinx closed 5 years ago
Hi @cklinx , Please can you give me your kuzzle and kuzzle-sdk version ?
Hi, how can i find out it? I'm using kuzzle in a a docker-compose with this line:
kuzzle: image: kuzzleio/kuzzle:latest
can you write here the commands?
thanks in advance
@cklinx,
You can find out the kuzzle version by typing the following command: curl localhost:7512?pretty | grep version
. The version should be the first line (something like "version": "1.x.x"
)
For the SDK you can find the version in the package.json file, under the kuzzle-sdk
dependency
Thanks for the commands =)
I was unable to reproduce your issue with the version you provided :(
Can you give the result of the following call ?
const response = await kuzzle.query({
controller: 'auth',
action: 'login',
strategy: 'local',
body: {
username: 'admin',
password: 'admin'
}
})
console.log(response)
Sure,
Object {
"action": "login",
"collection": null,
"controller": "auth",
"error": null,
"index": null,
"requestId": "0be152d9-ee5a-4887-9427-48a5f4d7ff22",
"result": Object {
"_id": "utente",
"expiresAt": 1561730629081,
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiJ1dGVudGUiLCJpYXQiOjE1NjE3MjcwMjksImV4cCI6MTU2MTczMDYyOX0.DPucG0QFHUAyVHw8avdHnZmr_hIMoNXAYQJb2-xjUlE",
"ttl": 3600000,
},
"room": "0be152d9-ee5a-4887-9427-48a5f4d7ff22",
"status": 200,
"volatile": Object {
"sdkInstanceId": "7f3f148b-53f6-4f1d-b33a-3b5fa2d3d1e6",
"sdkVersion": "6.1.3",
},
}
I moved this issue to the Javascript SDK repository since it seems to be related to this project.
Concerning your issue, it seems that the SDK is unable to parse the authentication token returned by Kuzzle (https://github.com/kuzzleio/sdk-javascript/blob/master/src/core/Jwt.js#L48).
But I try to manually set the authentication token manually and the SDK was able to parse it:
kuzzle.jwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiJ1dGVudGUiLCJpYXQiOjE1NjE3MjcwMjksImV4cCI6MTU2MTczMDYyOX0.DPucG0QFHUAyVHw8avdHnZmr_hIMoNXAYQJb2-xjUlE";
Did you use any transpiler like Typescript or Babel ?
I'm using Expo with react native. It use Babel.
Ok using this version
"kuzzle-sdk": "6.1.0",
its work fine! the problem i think is the
"kuzzle-sdk": "^6.1.0", version => 6.1.3.
Hello, I faced the same issue, but only when using the transpiled version of kuzzle (ie the one in the dist folder). And it's also with version 6.1.3.
Hi @cklinx and @barroudjo,
I fixed the issue, a new version of the SDK will be released soon, thanks you for your feedback !
Thanks @Aschen !
Fixed by #422 @barroudjo and @cklinx we will release a new version of the SDK this week
Hi, dont know but when i try to connect to my kuzzle server
i get this error: Invalid JSON payload for JWT
Username and password are correct cuz if i put wrong values the i get login error.
I try to reinstall a fresh one system but got same error.
Any idea?