Skip to content

Commit

Permalink
fix: set authToken after login by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jrea committed Jan 25, 2023
1 parent 7329144 commit de6992a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/react/src/components/LoginForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function LoginForm(props: Props) {
{
onSuccess: (token, data) => {
if (token) {
nile.authToken = token.token;
onSuccess && onSuccess(token, data);
}
},
Expand Down
4 changes: 3 additions & 1 deletion packages/react/src/context/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const NileProvider = (props: NileProviderProps) => {
children,
theme,
workspace,
tokenStorage,
QueryProvider = BaseQueryProvider,
basePath = 'https://prod.thenile.dev',
} = props;
Expand All @@ -48,9 +49,10 @@ export const NileProvider = (props: NileProviderProps) => {
basePath: basePath,
workspace: workspace,
credentials: 'include',
tokenStorage,
}),
};
}, [basePath, workspace]);
}, [basePath, tokenStorage, workspace]);

return (
<QueryProvider>
Expand Down

0 comments on commit de6992a

Please sign in to comment.