diff --git a/website/src/lib/oasst_api_client.ts b/website/src/lib/oasst_api_client.ts index 30fb9885..3f730b72 100644 --- a/website/src/lib/oasst_api_client.ts +++ b/website/src/lib/oasst_api_client.ts @@ -303,9 +303,8 @@ export class OasstApiClient { } async set_tos_acceptance(user: BackendUserCore) { - // TODO: it is wasteful having to get the backend user first and then set the tos status - // is there a better way of doing this? - const backendUser = await this.get(`/api/v1/frontend_users/${user.auth_method}/${user.id}`); + // NOTE: we do a post here to force create the user if it does not exist + const backendUser = await this.post(`/api/v1/frontend_users/`, user); await this.put(`/api/v1/users/${backendUser.user_id}?tos_acceptance=true`); } }