generated from azures04/Base-REST-API
Introduce bootstrap entrypoint and prestartup to ping DB and generate/manage RSA keypair. Add security module for key IO. Implement JWT-based access and refresh tokens (tokensService) with refresh_tokens table and repo. Add auth, provider and user services, and refresh-token management. Update repositories (users, credentials, providers, servers) with SQL fixes and new helper methods. Move DDL execution to bootstrap (remove from server). Update package.json main and add dependencies (bcryptjs, jsonwebtoken). Update .env.example and .gitignore accordingly.
7 lines
254 B
SQL
7 lines
254 B
SQL
CREATE TABLE IF NOT EXISTS `refresh_tokens` (
|
|
`userId` UUID PRIMARY KEY,
|
|
`tokenHash` TEXT NOT NULL,
|
|
`expiresAt` TIMESTAMP NOT NULL,
|
|
|
|
CONSTRAINT `fk_refreshTokens_userId` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
|
) |