mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): add optional token for auth
This commit is contained in:
parent
f6c6f61da6
commit
e69a65b304
1
invokeai/frontend/web/index.d.ts
vendored
1
invokeai/frontend/web/index.d.ts
vendored
@ -71,6 +71,7 @@ interface InvokeProps extends PropsWithChildren {
|
||||
apiUrl?: string;
|
||||
disabledPanels?: string[];
|
||||
disabledTabs?: InvokeTabName[];
|
||||
token?: string;
|
||||
}
|
||||
|
||||
declare function Invoke(props: InvokeProps): JSX.Element;
|
||||
|
@ -27,18 +27,24 @@ interface Props extends PropsWithChildren {
|
||||
apiUrl?: string;
|
||||
disabledPanels?: string[];
|
||||
disabledTabs?: InvokeTabName[];
|
||||
token?: string;
|
||||
}
|
||||
|
||||
export default function Component({
|
||||
apiUrl,
|
||||
disabledPanels = [],
|
||||
disabledTabs = [],
|
||||
token,
|
||||
children,
|
||||
}: Props) {
|
||||
useEffect(() => {
|
||||
if (apiUrl) OpenAPI.BASE = apiUrl;
|
||||
}, [apiUrl]);
|
||||
|
||||
useEffect(() => {
|
||||
if (token) OpenAPI.TOKEN = token;
|
||||
}, [token]);
|
||||
|
||||
return (
|
||||
<React.StrictMode>
|
||||
<Provider store={store}>
|
||||
|
Loading…
Reference in New Issue
Block a user