Skip to content

Commit

Permalink
fix: empty token generate error
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Guillemin committed May 21, 2024
1 parent 3d39e5a commit 288ae5e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/AppDev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ function App() {
mode={mode}
persistanceApiUrl={persistanceApiUrl ? VITE_PERSISTANCE_API_URL : undefined}
assetsApiUrl={assetsApiUrl ? VITE_ASSETS_API_URL : undefined}
userInfoApiUrl={VITE_USER_INFO_API_URI}
token={token.startsWith('Bearer ') ? token : undefined}
userInfoApiUrl={VITE_USER_INFO_API_URI}
darkMode={darkMode}
readOnly={readOnly}
autoSave={autoSave}
Expand Down
2 changes: 1 addition & 1 deletion src/components/TldrawEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function TldrawEditor({
if (!token && !userInfoApiUrl) throw new Error('Token or userInfoApiUrl is required');

if (token?.startsWith('Bearer ')) setToken(token);
else throw new Error('Invalid token');
else if (token) throw new Error('Invalid token');
if (userInfoApiUrl) setUserInfoApiUrl(userInfoApiUrl);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/types/TldrawEditorProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export type TldrawEditorProps = {
// Common properties
persistanceApiUrl?: string;
assetsApiUrl?: string;
userInfoApiUrl?: string;
token?: string;
userInfoApiUrl?: string;
darkMode?: boolean;
readOnly?: boolean;
autoSave?: boolean;
Expand Down

0 comments on commit 288ae5e

Please sign in to comment.