4946b7c6646d81ec07be075ef890e33723b7be8f..ea2e7e14933cfc6ef9934feef89cf2c4c5c40a98
2018-10-29 JOE
modify auth condition
ea2e7e diff | tree
2018-10-29 JOE
modify auth condition
3890d3 diff | tree
2018-10-29 JOE
modify auth condition
c0530e diff | tree
2018-10-29 JOE
modify auth condition
253b86 diff | tree
2018-10-29 JOE
modify path in login
872cee diff | tree
4 files modified
22 ■■■■ changed files
routes/index.js 1 ●●●● patch | view | raw | blame | history
util/util.js 3 ●●●●● patch | view | raw | blame | history
views/login.html 6 ●●●● patch | view | raw | blame | history
views/permission-test.html 12 ●●●● patch | view | raw | blame | history
routes/index.js
....@@ -19,7 +19,6 @@
1919 } catch(error) {
2020 token = '';
2121 }
22
- console.log(token);
2322 if(token == '') {
2423 res.render('login', param);
2524 } else {
util/util.js
....@@ -188,6 +188,9 @@
188188
189189 Modules.findOne({path: url}).then(function (module) {
190190 // res.json(module);
191
+ if(module == null)
192
+ resolve(false);
193
+
191194 const moduleId = module._id;
192195 if(-1 < data.accessibles.indexOf(moduleId)) {
193196 resolve(true);
views/login.html
....@@ -27,7 +27,7 @@
2727 <div class="title-login">
2828 Log In
2929 </div>
30
- <form class="login-account" method="post" accept-charset="utf-8">
30
+ <form class="login-account" action="{{context}}/login" method="post" accept-charset="utf-8">
3131 <div class="input-form">
3232 <span class="label">E-mail address</span>
3333 <input class="email-input" type="text" name="login_id" id="login_id" placeholder="E-mail address" autocomplete="on" tabindex="1" value="{{email}}">
....@@ -38,11 +38,11 @@
3838
3939 <input class="password-input" type="password" name="password" id="password" placeholder="Password" autocomplete="off" tabindex="2">
4040 </div>
41
- <button class="btn-login" type="submit" name="login-btn" formaction="{{contextRoot}}/login">Log In</button>
41
+ <button class="btn-login" type="submit" name="login-btn" formaction="{{context}}/login">Log In</button>
4242 </form>
4343 <div class="divider-login-lcell"></div>
4444
45
- <a href="{{contextRoot}}/signup" class="btn-create-account" tabindex="4">Create Account</a>
45
+ <a href="{{context}}/signup" class="btn-create-account" tabindex="4">Create Account</a>
4646 </div>
4747
4848 <div class="rcell">
views/permission-test.html
....@@ -33,14 +33,14 @@
3333 const path = $(this).attr('data-path');
3434 $.ajax({
3535 method: "GET",
36
- url: "{{contextRoot}}"+path,
36
+ url: "{{context}}"+path,
3737 data: {
3838 //for component api - /geo-location-circle
39
- zlevel: 8,
40
- locids: "1,2",
41
- bound: "1,2,3,4",
42
- //for members api
43
- memberId: "5b6974345389967bdf999a45"
39
+ // zlevel: 8,
40
+ // locids: "1,2",
41
+ // bound: "1,2,3,4",
42
+ // //for members api
43
+ // memberId: "5b6974345389967bdf999a45"
4444 }
4545 })
4646 .done(function( data ) {