Age | Commit message (Collapse) | Author |
|
- Add NextFunction type import from express
- Restructure route handlers to use proper Express middleware pattern
- Wrap async functions in IIFE for proper error handling
- Add proper error handling with next function
- Maintain existing functionality while satisfying TypeScript type system
This fixes TS2769 errors related to route handler type definitions
in /api/digiid/start and /api/digiid/callback endpoints.
|
|
- Remove extra space at the top of the page by adjusting body and root styles
- Add consistent 20px top padding to all views through app-container
- Simplify layout structure by removing unnecessary flex containers
- Adjust spacing between elements for better visual hierarchy:
- Reduce gaps between elements from 1.5rem to 1rem
- Reduce bottom margin of h1 from 1.5rem to 1rem
- Remove negative margins and extra padding
- Maintain consistent box dimensions (390px width, 560px height) for all views
- Ensure proper spacing for QR code and other content within views
|
|
- Added local `digiid-ts` library as a file dependency in `package.json`.
- Moved runtime dependencies (react, express, etc.) to `dependencies` section.
- Updated `src/server/main.ts`:
- Imported `generateDigiIDUri`, `verifyDigiIDCallback`, and `DigiIDError` from `digiid-ts`.
- Replaced placeholder URI generation with `generateDigiIDUri`.
- Replaced placeholder callback verification with `verifyDigiIDCallback`.
- Refactored `/api/digiid/callback` handler to use `try...catch` for verification, handling thrown `DigiIDError` on failure as per library design.
- Ensured session state is updated and 200 OK response sent in `finally` block.
- Cleaned up related placeholder comments in `src/server/main.ts`.
- (Requires `npm install` to be run after checkout)
|
|
- Added basic Express server setup in `src/server/main.ts`.
- Configured `dotenv` to load environment variables.
- Implemented in-memory storage for session state (pending, success, failed).
- Created `/api/digiid/start` endpoint:
- Generates session ID and nonce.
- Constructs callback URL from `PUBLIC_URL`.
- Determines `unsecure` flag based on URL scheme.
- Stores initial session state.
- Generates QR code data URL.
- Returns `sessionId` and `qrCodeDataUrl`.
- Includes placeholder for `digiidTs.generateDigiIDUri`.
- Created `/api/digiid/callback` endpoint:
- Receives address, uri, signature from DigiID app.
- Parses nonce from received URI.
- Looks up session by nonce.
- Reconstructs expected callback URL.
- Updates session state based on placeholder verification.
- Includes placeholder for `digiidTs.verifyDigiIDCallback`.
- Responds 200 OK as per DigiID protocol.
- Created `/api/digiid/status/:sessionId` endpoint:
- Retrieves and returns session status, address, and error.
- Added address type helper `getDigiByteAddressType` in `src/server/utils.ts` (with placeholder logic for DGA).
- Added `dev:backend` script to `package.json` using `nodemon` and `ts-node/esm`.
- Added `"type": "module"` to `package.json`.
- Installed `@types/dotenv`.
- (Note: Outstanding TypeScript linter errors related to async Express handlers require further investigation).
|