فهرست منبع

added route 'forgotpassword'

kaori 4 سال پیش
والد
کامیت
d4fa00402f
2فایلهای تغییر یافته به همراه25 افزوده شده و 0 حذف شده
  1. 3 0
      src/server/routes/index.js
  2. 22 0
      src/server/routes/password.js

+ 3 - 0
src/server/routes/index.js

@@ -28,6 +28,7 @@ module.exports = function(crowi, app) {
   const tag = require('./tag')(crowi, app);
   const search = require('./search')(crowi, app);
   const hackmd = require('./hackmd')(crowi, app);
+  const password = require('./password')(crowi, app);
 
   const isInstalled = crowi.configManager.getConfig('crowi', 'app:installed');
 
@@ -175,6 +176,8 @@ module.exports = function(crowi, app) {
   app.post('/_api/hackmd.discard'        , accessTokenParser , loginRequiredStrictly , csrf, hackmd.validateForApi, hackmd.discard);
   app.post('/_api/hackmd.saveOnHackmd'   , accessTokenParser , loginRequiredStrictly , csrf, hackmd.validateForApi, hackmd.saveOnHackmd);
 
+  app.get('/password', password.forgotpassword);
+
   app.get('/share/:linkId', page.showSharedPage);
 
   app.get('/*/$'                   , loginRequired , page.showPageWithEndOfSlash, page.notFound);

+ 22 - 0
src/server/routes/password.js

@@ -0,0 +1,22 @@
+module.exports = function(crowi, app) {
+  const ApiResponse = require('../util/apiResponse');
+
+  const actions = {};
+  const api = {};
+
+  /*
+   TODO: add swagger
+  */
+
+  // api.get = async function(req, res) {
+  //   return res.json(ApiResponse.success('hoge'));
+  // };
+
+  actions.forgotpassword = async function(req, res) {
+    return res.json(ApiResponse.success('hogesss'));
+    // return res.redirect('/password');
+  };
+
+  actions.api = api;
+  return actions;
+};