Following tutorial here:
https://docs.amplify.aws/vue/build-a-backend/functions/examples/create-user-profile-record/
I get error when post-confirmaiton runs:
2024-05-29T23:49:34.456Z undefined ERROR Uncaught Exception
{
"errorType": "TypeError",
"errorMessage": "Cannot read properties of undefined (reading 'loginWith')",
"stack": [
"TypeError: Cannot read properties of undefined (reading 'loginWith')",
" at AmplifyClass.notifyOAuthListener (file:///var/task/index.mjs:27042:44)",
" at AmplifyClass.configure (file:///var/task/index.mjs:27023:10)",
" at Object.configure (file:///var/task/index.mjs:30481:15)",
" at file:///var/task/index.mjs:33705:16",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
]
}
My ./amplify/auth/resources.ts is set up correctly:
import { defineAuth } from "@aws-amplify/backend";
import { postConfirmation } from "./post-confirmation/resource";
/**
* Define and configure your auth resource
* @see https://docs.amplify.aws/gen2/build-a-backend/auth
*/
export const auth = defineAuth({
loginWith: {
email: true
},
groups: ["admin", "employee", "tenant", "stakeholder", "allusers"],
triggers: {
postConfirmation
},
access: allow => [allow.resource(postConfirmation).to(["addUserToGroup"])]
});
Any help would be appreciated.
Handler and models are attached.