setSession fix (#395)

This commit is contained in:
Ilya Y 2024-02-04 07:45:49 +03:00 committed by GitHub
parent c794b9cb91
commit 9bff49e711
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -276,7 +276,7 @@ export const SessionProvider = (props: {
const authenticate = async (authFunction, params) => {
const resp = await authFunction(params)
console.debug('[context.session] authenticate:', resp)
if (resp?.data && !resp.errors) {
if (resp?.data && resp?.errors.length === 0) {
setSession(resp.data)
}
return { data: resp?.data, errors: resp?.errors }