diff options
author | Pawel Zelawski <pawel.zelawski@outlook.com> | 2025-04-10 10:50:57 +0200 |
---|---|---|
committer | Pawel Zelawski <pawel.zelawski@outlook.com> | 2025-04-10 10:50:57 +0200 |
commit | 326caf949ec8622c04b0e3352c5eac5370f161e4 (patch) | |
tree | 5b4d1dbeeb693e25dce770e393645a60f1e409a9 /src/client/index.css | |
parent | ef435a15ca67c829ce6cd8551ac45c419cb9792e (diff) |
feat(server): implement basic backend API
- 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).
Diffstat (limited to 'src/client/index.css')
0 files changed, 0 insertions, 0 deletions