You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switching from Next.js 14.1.4 to 14.2.6 causes all amplify auth methods to not get called successfully - the functions, specifcally fetchAuthSession and getCurrentUser, either stalls or fails silently - very strange! Next.js 14.1.4 was working fine, as expected.
Expected behavior
I expect the awaited function to be run successfully and return data
Reproduction steps
install next@14.2.16 and aws-amplify/auth@6.6.0
call fetchAuthSession or getCurrentUser
Code Snippet
// Put your code below this line.'use client'import{fetchAuthSession,getCurrentUser}from'aws-amplify/auth'import{User}from'../../_types'importuserStorefrom'@/app/_stores/userStore'exportdefaultasyncfunctiongetUserClient(){try{constsession=awaitfetchAuthSession()if(!session.tokens)returnconstuserRes=awaitgetCurrentUser()userStore.getState().setUser(userasUser)}catch(error){console.error(error)}
oznekenzo
changed the title
updating nextjs from 14.1.4 to 14.2.16 causes aws-amplify/auth functions to fail silently
updating nextjs from 14.1.4 to 14.2.16 causes aws-amplify/auth functions to hang
Nov 4, 2024
oznekenzo
changed the title
updating nextjs from 14.1.4 to 14.2.16 causes aws-amplify/auth functions to hang
Updating NextJS from 14.1.4 to 14.2.16 causes aws-amplify/auth functions to hang
Nov 4, 2024
@oznekenzo We have integration tests running on "next": "14.2.10", and there is no issue there. Can you provide us with a reproducible code sample/repo so we can figure out what is causing this issue.
Was likely a combination of issues that was going on. I was missing import 'aws-amplify/auth/enable-oauth-listener' on top of this, and was seeing a different behavior in local vs my staging and development environments, but now everything is working - closing.
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
Amplify Gen 2
Environment information
Describe the bug
Switching from Next.js 14.1.4 to 14.2.6 causes all amplify auth methods to not get called successfully - the functions, specifcally
fetchAuthSession
andgetCurrentUser
, either stalls or fails silently - very strange! Next.js 14.1.4 was working fine, as expected.Expected behavior
I expect the awaited function to be run successfully and return data
Reproduction steps
fetchAuthSession
orgetCurrentUser
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: