180 likes
·
6.0K reads
6 comments
Great article, learned a lot from it!
I want to make authorized API call to Amplify from the front end, how should I go about that? I tried just calling Auth.currentSession but I believe that works with cookies.
Hi Rick,
If you're using Amplify auth, then this article is not a good starting point. This article is primarily for integrating your own Auth2.0 solution.
This may be a better starting point for Amplify auth (docs.amplify.aws/lib/auth/getting-started/…)
Great article, Kelvin! I have issues with typescript: Property 'accessToken' does not exist on type 'Session'.ts(2339) with .accessToken .idToken and .error . Did you face this issues or did I do something wrong? Thanks.
To resolve this, you can extend the Session interface in Next-Auth:
declare module "next-auth" { interface Session { user: { accessToken: string; tokenExpiration: number; idToken: string; } & DefaultSession["user"]; error: string; } }
Brother, I'm so thankful for you and this post. <3
Fantastic