diff --git a/demos/django-react-native-todolist/app/views/todos/lists.tsx b/demos/django-react-native-todolist/app/views/todos/lists.tsx index 6a9e8da9..47ca12d4 100644 --- a/demos/django-react-native-todolist/app/views/todos/lists.tsx +++ b/demos/django-react-native-todolist/app/views/todos/lists.tsx @@ -34,7 +34,7 @@ const App = () => { return; } - const { userID } = await system.djangoConnector.fetchCredentials(); + const userID = await system.djangoConnector.userId(); await system.powersync.execute( `INSERT INTO ${LIST_TABLE} (id, created_at, name, owner_id) VALUES (uuid(), datetime(), ?, ?)`, diff --git a/demos/django-react-native-todolist/library/django/DjangoConnector.ts b/demos/django-react-native-todolist/library/django/DjangoConnector.ts index e6ca31dd..11e689e9 100644 --- a/demos/django-react-native-todolist/library/django/DjangoConnector.ts +++ b/demos/django-react-native-todolist/library/django/DjangoConnector.ts @@ -35,6 +35,10 @@ export class DjangoConnector implements PowerSyncBackendConnector { return this.apiClient.register(username, password); } + async userId() { + return Storage.getItem('id'); + } + async fetchCredentials() { // The demo does not invalidate or update a user token, you should implement this in your app // The app stores the user id in local storage diff --git a/demos/react-native-supabase-todolist/app/views/todos/edit/[id].tsx b/demos/react-native-supabase-todolist/app/views/todos/edit/[id].tsx index 9fd9c6f8..f6c7b163 100644 --- a/demos/react-native-supabase-todolist/app/views/todos/edit/[id].tsx +++ b/demos/react-native-supabase-todolist/app/views/todos/edit/[id].tsx @@ -86,7 +86,7 @@ const TodoView: React.FC = () => { }; const createNewTodo = async (description: string) => { - const { userID } = await system.supabaseConnector.fetchCredentials(); + const userID = await system.supabaseConnector.userId(); await powerSync.execute( `INSERT INTO