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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Hi there,
I am trying to build a simple login button with next-auth.js so that when the user clicks on it, it will redirect the user to SSO login.
As you can see, there are three methods from 'next-auth/react', UseSession, signIn and signOut, so I think I will need to mock/make them work.
I have followed this article: https://dev.to/lada496/storybook-nextauth-how-to-set-mock-auth-session-2ell
and make the UseSession worked with storybook.
My problem is that when I click the button in storybook, it throw out errors in console.
Looks like it is calling the real signIn and signOut function from 'next-auth/react', wondering how can I mock those functions in story book?
Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions