nhost / hasura-auth

Authentication for Hasura.
https://nhost.io
MIT License
385 stars 114 forks source link

error: map is not a function when adding options to `signIn({ provider: linkedin })` #341

Closed juicygoose closed 1 year ago

juicygoose commented 1 year ago

I am having trouble adding options to the signIn call when using the linkedin provider. Hasura-Auth fails with this error:

2023-01-23 15:58:28 - hasura-auth: at transformOauthProfile (/app/dist/routes/oauth/utils.js:40:141)
2023-01-23 15:58:28 - hasura-auth
TypeError: ((intermediate value)(intermediate value)(intermediate value) || utils_1.ENV.AUTH_USER_DEFAULT_ALLOWED_ROLES).map is not a function

I have tried opening the code and found the transformOauth... method but don't understand why it would fail when calling signIn like this:

    nhost.auth.signIn({
      provider: "linkedin",
      options: {
        allowedRoles: [ "user", "me", "freelance" ]
        defaultRole: "freelance",
      },
    });

Any ideas about this ?

Thanks a looot

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.