setAuth() is not returning { user, error } when called server side
Bug report
Describe the bug
It seems like the documentation for setAuth() is wrong. The express example shows { user, error } as the returned object. However, it seems like this is not implemented: https://github.com/supabase/gotrue-js/blob/edcd2ffde6dfe81d02700a52a79e635a5ab8839d/src/GoTrueClient.ts#L389
As far as I understand it, this is what is used for server side calls, correct?
Expected behavior
Return { user, error } as documented, also server side.
System information
- OS: macOS
- Version of supabase-js: v16.1.0^1.31.1
- Version of Node.js: v16.1.0
Yes, you're correct. Not sure when the docs will reflect this - or if there are plans to include error in the returned object, but you can contribute to the docs if you'd like - https://github.com/supabase/supabase/blob/master/DEVELOPERS.md
On the server-side, it returns an object with access_token: with a value of whatever you provided it, token_type: bearer, and user: null.
Only on the client-side does it return this info, plus info for the user associated with the token and the current session.
There has been a lot of changes with respect to server side rendering in v2 of the library, which should address this issue.