Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

140
Visualizações
Global wrapper for Storybook (Custom authentication layer)

Hello, this is my first question on Stack Overflow.

I'm trying to add a simple authentication layer using an organization library that relies on AD (Active Directory) and client routing. So I'll need to add a wrapper, there's no need for a Home component.

I've been searching two days about how to add an "parent" layer inside Storybook with no luck.

I've tried to add a global decorator, but it's not working for documentation stories and it's displaying Storybook's UI. (X) This doesn't work for my use case.

After that I've created a CRA app that handles routing, I added a Home page with a login button, and tried to add a catch all route to handle static output from storybook build, it's getting built inside public folder, under a nested one called storybook. (public/storybook/)

<Router>
    <Switch>
        <Route path="/" component={Home} exact />

        <Route path="/storybook/" onEnter={requireAuth} />
        <Redirect to={CONFIG_GENERAL.REDIRECT.path} />
    </Switch>
</Router>

This is failing in client side, because it's been served as a static route, it's been handled server side. (Another issue here would be on built time, there would be two main index files..., one containing the React app that handles authentication routing and the Storybook's one).

I've tried many shots with no luck following this path, so I've started to feel that the only way to handle this is somehow inside Storybook's world, again...

NOTE: Despite I'm starting to feel that the only way to handle authentication is on server side with two different paths, the "home.html" and "storybook.html", this is not how I can do it, I "~must" need it to be client side handled.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda