Mock Authentication in storybook

Hi there,

I’m new to RedwoodJS and Storybook, and I’m encountering an issue while trying to mock authentication in one of my stories. I’m using Supabase for authentication in my project.

I’ve seen that you can use mockCurrentUser to mock the user, which resolves the UNAUTHENTICATED error i had. However, after applying this, I’m now seeing the following error:

Error: Exception in getAuthenticationContext: The Authorization header is not valid.

Here’s the code I’m using in the story:

export const Primary = () => {
mockCurrentUser({
    sub: '1',
    email: 'user@example.com',
    roles: ['admin'],
  })
  return <ContactPage id={10} />
}

I’ve searched the documentation, but I can’t find any information on how to mock the Authorization header in Storybook. Any guidance would be greatly appreciated!

Problem solved: I had simply missed the subcomponents property in Storybook