Hi all,
The OnAuth method can only return the false value,right? What should I do if I want to return custom data after a validation failure?
Thanks.😁
for example:
onAuth(client, options): Promise < any > {
return new Promise((resolve, reject) => {
let myData = {
code: -1,
reason: 'token is missing'
}
reject(myData);
});
}
//other test
onAuth(client, options): Promise < any > {
let myData={
code: -1,
reason: 'token is missing'
}
return myData;
}
//and the client side
client.joinOrCreate("test").then(room => {
}).catch(err => {
//the err is null str
});