Is there a way to set/update the auth url on the fly? #795
Unanswered
notmatthewa
asked this question in
Q&A
Replies: 2 comments 2 replies
-
You can swizzle and modify the code here: You can change the servers or modify the urls to whaterver. For example, I replaced the const { domainName } = siteConfig.customFields.brandConfig as any;
const servers = api?.servers?.map((server) => ({ ...server, url: server.url?.replace('VAR::DOMAIN_NAME', domainName) })) ?? []; |
Beta Was this translation helpful? Give feedback.
2 replies
-
You have to swizzle @theme/ApiExplorer and @theme/ApiItem |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently working on integrating custom authentication functionality to accommodate multiple client-specific API URLs within our setup. As part of this, I need to dynamically update the "Auth URL" displayed in the sidebar on each API page to reflect the correct URL for different clients.
After exploring the theme's code, I noticed a middleware action named
server/setServer
, which seems to be relevant to what I'm trying to achieve. However, as I'm not deeply experienced with React, I'm uncertain about the best way to utilize this action for my purpose.Is my approach of using server/setServer to dynamically change the Auth URL on the fly the correct path to follow? I would greatly appreciate any guidance or insight on how to properly implement this functionality or if there's an intended method for updating the Auth URL that I might have overlooked.
Thank you for your time and help!
Beta Was this translation helpful? Give feedback.
All reactions