When I call authClient.login, I can log in successfully and get the identity, but when I call the getUser function in canister, it will prompt me a 403 error.
Code: 403 (Forbidden)
Body: Failed to authenticate request
For LOCAL DEVELOPMENT ONLY your app doesn’t have access to the IC root key, so after creating your agent (in your setActor function) you’ll need to call
await agent.fetchRootKey()
before creating the actor.
It’s important that you DO NOT do this in your production deployment, or you’ll open your users up to possible Man in the Middle attacks.
Are you running both Internet Identity and your project on the same replica instance? So just run dfx start once from your project directory, then deploy both your project and the II project to that.