Skip to content

Using the Web Crypto API for user authentication

Notifications You must be signed in to change notification settings

ic3software/did-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e412335 · Mar 25, 2025

History

17 Commits
Mar 22, 2025
Mar 25, 2025
Mar 25, 2025
Mar 19, 2025
Feb 26, 2025
Mar 19, 2025
Feb 17, 2025
Mar 22, 2025
Mar 19, 2025
Mar 22, 2025
Mar 19, 2025
Mar 19, 2025
Mar 22, 2025
Mar 22, 2025
Mar 19, 2025
Mar 19, 2025
Mar 19, 2025
Mar 19, 2025
Feb 17, 2025
Mar 19, 2025

Repository files navigation

DID Auth

Local Development

1. Install dependencies

pnpm install

The project uses Husky and lint-staged to enforce code quality checks before each commit. These are automatically set up when you run pnpm install thanks to the prepare script.

When you try to commit changes, the following checks will run automatically on staged files:

  • Prettier formatting check
  • ESLint with zero warnings allowed

If any checks fail, the commit will be blocked until you fix the issues.

2. Setup Drizzle and SQLite

  1. Generate the schema

    pnpm db:generate
  2. Push the migrations

    pnpm db:migrate

3. Run the app

pnpm dev

Database Schema Diagram

https://dbdiagram.io/d/DID%2FUCAN-67cae800263d6cf9a096e5dd

IndexedDB Console Commands

You can use JavaScript to view and delete the key pair stored in IndexedDB.

// Show the key pair
let dbRequest = indexedDB.open('cryptoKeysDB', 1);
dbRequest.onsuccess = function (e) {
  const db = e.target.result;
  const transaction = db.transaction('keys', 'readonly');
  const objectStore = transaction.objectStore('keys');
  const request = objectStore.getAll();
  request.onsuccess = function () {
    console.log(request.result);
  };
};

// Delete the database
indexedDB.deleteDatabase('cryptoKeysDB');

The last command is useful if you want to remove the current key pair.

To avoid having to delete key pairs repeatedly when you are testing, just use private browsing windows.