kucherenko / strapi-plugin-passwordless

A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email.
MIT License
77 stars 27 forks source link

Fix for when sanitizer removes user.email #8

Closed GraemeFulton closed 1 year ago

GraemeFulton commented 1 year ago

This sanitizer removes the user.email: https://github.com/kucherenko/strapi-plugin-passwordless/blob/main/server/services/passwordless.js#L166

and because email is null, this check fails: https://github.com/kucherenko/strapi-plugin-passwordless/blob/main/server/controllers/auth.js#L107

https://github.com/kucherenko/strapi-plugin-passwordless/issues/5#issuecomment-1182297456

I don't know the cause, but the sanitizer could have been modified somewhere else in Strapi (maybe another plugin?). That change will ensure the email is always returned

just saw on the readme pull requests are welcome, so here you go!