Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!