Make example save identities and users to a simple file to preserve users and identities between restarts.

Open Beginner friendly
#54 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
typescript, yaml
Domain
backend, databases

Research direction

Look for the in-memory stores for users and identities in the example code. Create a new module file (e.g., file-store.ts) that reads from and writes to a YAML file. Integrate this module to replace the current volatile storage. Test by restarting the server and verifying that a previously registered passkey is still recognized.

Written by the indexing model from the issue text.

Description

this example keeps users, identities, and passkey credentials in memory, so restarting the server forgets them all. A passkey saved in your password manager survives the restart, but the server no longer recognizes it (“Unknown credential”) — delete it there and add a new one. A real app would back the stores with a database.
We should just remove this issue from the example. Saving the users as a simple YAML file in the example somewhere would be perfectly fine and make it more robust.

This wasn't really an issue with emails and SMS, but with passkeys it's pretty damning.

Use simple text files, not SQLite or something, just to keep the example as simple as possible.

We can encapsulate the datastore into a separate module file to keep it separate from the rest of the example.

Dominant language
TypeScript
Stars
0
Forks
1
Avg merge
2d 5h
Merged PRs (30d)
32

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from activescott/auth

All issues in activescott/auth

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.