Closed strickon closed 4 months ago
Hey @strickon, thank you for reaching out. The issue appears to be similar to https://github.com/aws-amplify/amplify-js/issues/13466. A fix was released on aws-amplify@6.3.6
could you upgrade to latest version of the package and retry this.
Closing this issue as duplicate, if you do experience the issue after the upgrade do add a comment on https://github.com/aws-amplify/amplify-js/issues/13466.
the update fixed the issue
Environment information
Description
I have setup a test app in nextjs using email in define auth. I am logging in using withauthenticator and everything works fine. Once I add my external SAML provider in my defineAuth, the authenticator throws an error. I understand that the authenticator won't use SAML yet and I have a workaround to use a button in the footer. However, this shouldn't cause the email login to longer work. It seems that there should be some way to default to email. The examples of using Facebook, Google and Apple definitely allow for multiple providers.
app-index.js:35 Missing onError handler for invocation 'authenticator.setup.getConfig:invocation[0]', error was 'TypeError: Cannot read properties of undefined (reading 'toString')'. Stacktrace was 'TypeError: Cannot read properties of undefined (reading 'toString')
My define auth is similar to this but using saml instead. If I remove the authenticator and only use my saml login button with sigininwithredirect, my saml redirects fine. So it appears is something in how the react authenticator component is handling the list of auth providers.
import { defineAuth, secret } from '@aws-amplify/backend';
export const auth = defineAuth({ loginWith: { email: true, externalProviders: { oidc: [ { name: 'MicrosoftEntraID', clientId: secret('MICROSOFT_ENTRA_ID_CLIENT_ID'), clientSecret: secret('MICROSOFT_ENTRA_ID_CLIENT_SECRET'), issuerUrl: '',
},
],
logoutUrls: ['http://localhost:3000/', 'https://mywebsite.com'],
callbackUrls: [
'http://localhost:3000/profile',
'https://mywebsite.com/profile',
],
},
},
});