Closed f2re closed 1 year ago
are you running this in a browser? cause wax.login() should open a window to ask the user to login to the system
are you running this in a browser? cause wax.login() should open a window to ask the user to login to the system
Yea, in browser. Its not open window, it send request and got error 422. For user nothing happend.
Maybe it help - im testing on localhost. But in previous version it works normally on localhost too.
422 is normal for a login call, because by default it will try to auto log you in that is what the 422 error is coming from after this there should be a popup coming up with login dialog can you check if there are any console errors?
What I found also:
Uncaught (in promise) ReferenceError: Buffer is not defined
loginViaWindow WaxSigningApi.js:124
__awaiter WaxSigningApi.js:8
__awaiter WaxSigningApi.js:4
loginViaWindow WaxSigningApi.js:118
login WaxSigningApi.js:40
__awaiter WaxSigningApi.js:8
__awaiter WaxSigningApi.js:4
login WaxSigningApi.js:37
login index.js:81
__awaiter index.js:8
__awaiter index.js:4
login index.js:79
login wax.js:37
loginProvider App.vue:480
didOpen App.vue:306
didOpen App.vue:303
Ze vue-sweetalert.umd.js:1
setTimeout handler*Ze vue-sweetalert.umd.js:1
Vo vue-sweetalert.umd.js:1
Vo vue-sweetalert.umd.js:1
_main vue-sweetalert.umd.js:1
_main vue-sweetalert.umd.js:1
qo vue-sweetalert.umd.js:1
e vue-sweetalert.umd.js:1
_n vue-sweetalert.umd.js:1
showLogin App.vue:291
mounted App.vue:545
VueJS 2
click Login.vue:54
VueJS 33
WaxSigningApi.js:124
this error in @waxio/waxjs/dist/WaxSigningApi.js
:
loginViaWindow() {
return __awaiter(this, void 0, void 0, function* () {
const url = new URL(`${this.waxSigningURL}/cloud-wallet/login`);
if (this.returnTempAccount) {
url.searchParams.append("returnTemp", "true");
}
if (version_1.version) {
url.searchParams.append("v", Buffer.from(version_1.version).toString("base64"));
}
if (this.nonce) {
url.searchParams.append("n", Buffer.from(this.nonce).toString("base64"));
}
const confirmationWindow = yield this.waxEventSource.openEventSource(url.toString());
return this.waxEventSource.onceEvent(confirmationWindow, this.waxSigningURL, this.receiveLogin.bind(this), undefined);
});
}
Buffer is not defined and not included in @waxio/waxjs/dist/WaxSigningApi.d.ts
Thanks, I see this too, but Im using vue-cli loader, and all instructions from stackoverflow not working. Maybe you can say how I can include Buffer in .ts file? or anything else....
Hey, Im insert next code in main.js
and it works! Thank you very much!
import Buffer from "vue-buffer";
// @ts-ignore
window.Buffer = Buffer;
341742
Im update waxjs version because old version alert "You need to update version to use WAX". After update, Im trying to login to WAX as this:
but I have 422 error:
and responce content:
How to resolve this error?