rocicorp/replicache-old

Flesh out login in the sample app ever so slightly more

Closed this issue · 2 comments

Right now the userID is hard-coded into the sample app. Let's push this one step further to completion. After this it would actually be possible to use the Todo app by multiple humans on phones.

  • On first-run the TODO app should ask the user for their email address. There will be no verification of the email address at all.
  • Use the email to login to the data layer. This returns a user ID.
  • The user ID itself will be sent as the auth token to the data layer.
  • The user ID and email address of the current user will be stored persistently in the client so that when it starts up offline it still knows it.
  • It will be possible to "log out" of the client by just clearing the stored email address
  • There is machinery in Replicache client currently to create multiple named caches. Use this to create one for each user so that we can demonstrate switching users offline and without redownloading everything.
  • Deal with badAuth

On the backend this implies:

  • Adding email address to User table
  • Adjusting the create-todo handler and a few other pieces
arv commented

Looks good. I'll take replicache-client and replicache-sdk-flutter part of this

LGTM.