This commit is contained in:
yaoyanwei
2025-08-04 16:25:38 +08:00
parent 8d542ea201
commit 4b2bb35c20
46 changed files with 5128 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
const AuthController = require('./auth.controller');
const AuthTool = require('./auth.tool');
exports.route = function (app) {
//Body: username, password
app.post('/auth', app.auth_limiter, [
AuthTool.isLoginValid,
AuthController.Login
]);
//Body: refresh_token
app.post('/auth/refresh', app.auth_limiter, [
AuthTool.isRefreshValid,
AuthController.Login
]);
app.get('/auth/keep',[
AuthTool.isValidJWT,
AuthController.KeepOnline
]);
app.get('/auth/validate',[
AuthTool.isValidJWT,
AuthController.ValidateToken
]);
app.get("/auth/proof/create", [
AuthTool.isValidJWT,
AuthController.CreateProof
]);
app.get("/auth/proof/:username/:proof", [
AuthTool.isValidJWT,
AuthController.ValidateProof
]);
app.get('/version', [
AuthController.GetVersion
]);
};