-
-
Notifications
You must be signed in to change notification settings - Fork 524
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
[Feedback] Authentication - @colyseus/auth #660
Comments
Hi @SleepingProgrammer, thanks for checking out! The
(See config on webgame-template repo) Soon the |
Final release notes are out 🎉 https://github.com/colyseus/colyseus/releases/tag/0.15.15 |
Thanks for letting me know and happy new year! I haven't had the time to try out your earlier suggestion, does that mean I can just force colyseus/core to use 0.15.15? |
Hi @SleepingProgrammer, yes 🙌 |
https://docs.colyseus.io/authentication/module/#onfinduserbyemail-setting What is the expected behavior if a user isn't found? are you supposed to throw an error yourself ? I think the documentation needs to reflect this Presumably the colysesus db package throws the error internally somewhere here https://github.com/colyseus/webgame-template/blob/main/packages/backend/src/config/auth.ts#L10 |
Hi @JeromeGill, thank you for the feedback. There was a bug getting the return value from You may customize the error by throwing a different one inside |
I'm a little concerned about the change to make Also, we use the I can see having a static onAuth being useful for optimizations, but deprecating the existing version creates some problems. We could still do a lot of it in onJoin, possibly, except we don't get the |
Just, for example what we pass to our onAuth and use from the client:
We also do a check on the # of players in the room. This is so we can allow ADMIN into the rooms even if they are otherwise full for other players. This works because most of our rooms are "single instance" and we prevent creation of duplicate rooms. We turn people away if they are full, rather than spin up a new instance of the same area. Conceivably, I think most of these things can be in onJoin, but we cannot benefit from the static onAuth unless we could access all the options passed in from the client. |
I expect static onAuth() when return data I can get it on onJoin or onCreate, currently can't get it . What purpose static onAuth () ??? . |
Hi @hungnvbb, the return value from onJoin(client, options, auth) {
console.log(client.auth) // here
console.log(auth) // here
} Let me know if that works for you |
Hi @endel This is my code .
and in onJoin I printed auth , client.auth result is undefined . |
Wishlist:
|
This thread is for general feedback for the new
@colyseus/auth
module (#657, colyseus/colyseus.js#133, colyseus/docs#150)The text was updated successfully, but these errors were encountered: