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

Question about finding default authenticated role #7

Closed rndexe closed 2 years ago

rndexe commented 2 years ago

Hi,

I've been facing a weird intermittent issue where sometimes the newly created user get assigned a Public role instead of Authenticated role despite never changing the setting in User-Permissions. I haven't been able to reliably reproduce it but I suspect it is this line

https://github.com/kucherenko/strapi-plugin-passwordless/blob/750f4f50b660b626b3cd6d739305d635d40cc2cc/server/services/passwordless.js#L51

Is this syntax supported in v4? Should the params be an object as given in the docs at

https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.html#findone

findOne( {  
    where : { type : userSettings.default_role }  
})

Please let me know if this is intended or am I missing something. Thank you.

kucherenko commented 2 years ago

thank you for the report, will fix it

kucherenko commented 2 years ago

The issue has been fixed at strapi-plugin-passwordless@4.0.8