@sassoftware/viya-serverjs 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,8 +29,9 @@ function _logon() {
29
29
  return (0, _setCookies["default"])(req, h, null);
30
30
  case 1:
31
31
  r = _context.v;
32
+ console.log('logon setcookie result:', r);
32
33
  debug(r.redirect);
33
- debug('in logon after setcookie', r.redirect);
34
+ console.log('in logon after setcookie', r.redirect);
34
35
  return _context.a(2, h.redirect(r.redirect));
35
36
  }
36
37
  }, _callee);
@@ -25,30 +25,26 @@ function _setCookies() {
25
25
  case 0:
26
26
  debugger;
27
27
  credentials = req.auth.credentials;
28
- debug('setcookie', credentials);
29
- if (!(credentials != null && req.auth.error != null)) {
30
- _context.n = 1;
31
- break;
28
+ debug('setcookie', credentials != null);
29
+ if (credentials != null && req.auth.error != null) {
30
+ console.log('setcookie credentials', credentials);
31
+ debug('setcookie error', req.auth.error);
32
+ console.log('Authentication error:', req.auth.error);
33
+ process.exit(0);
34
+ // return { status: false, error: req.auth.error, redirect: '/error' };
32
35
  }
33
- debug('setcookie credentials', credentials);
34
- debug('setcookie error', req.auth.error);
35
- debug('logon failed');
36
- return _context.a(2, {
37
- status: false,
38
- error: req.auth.error
39
- });
40
- case 1:
36
+
41
37
  // create a cookie(sid) and save credentials in cache
42
38
  sid = uuid.v4();
43
39
  credentials.sid = sid;
44
40
  if (options != null) {
45
41
  options.allAppEnv.LOGONPAYLOAD.token = credentials.token;
46
42
  options.allAppEnv.LOGONPAYLOAD.tokenType = 'bearer';
47
- debug(options.allAppEnv.LOGONPAYLOAD);
43
+ // debug(options.allAppEnv.LOGONPAYLOAD);
48
44
  }
49
- _context.n = 2;
45
+ _context.n = 1;
50
46
  return req.server.app.cache.set(sid, credentials, 0);
51
- case 2:
47
+ case 1:
52
48
  // Can we get away without setting cookie for this session?
53
49
  // Need to also modify keepAlive
54
50
  if (process.env.COOKIES !== 'NO') {
package/lib/iService.js CHANGED
@@ -449,6 +449,7 @@ function _getTls() {
449
449
  cert: pems.cert,
450
450
  key: pems["private"]
451
451
  };
452
+ console.log('Self-signed certificates created', tls);
452
453
  return _context3.a(2, tls);
453
454
  }
454
455
  }, _callee3);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sassoftware/viya-serverjs",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Easy to use app server for SAS Viya applications",
5
5
  "author": "Deva Kumaraswamy <deva.kumar@sas.com>",
6
6
  "license": "Apache-2.0",
@@ -11,8 +11,9 @@ async function logon (req, h) {
11
11
 
12
12
 
13
13
  let r = await setCookies(req, h, null);
14
+ console.log('logon setcookie result:', r);
14
15
  debug(r.redirect);
15
- debug('in logon after setcookie', r.redirect);
16
+ console.log('in logon after setcookie', r.redirect);
16
17
  return h.redirect(r.redirect);
17
18
  }
18
19
 
@@ -8,13 +8,14 @@ let debug = require('debug')('setcookies');
8
8
  async function setCookies (req, h, options) {
9
9
  debugger;
10
10
  let credentials = req.auth.credentials;
11
- debug('setcookie', credentials);
11
+ debug('setcookie', credentials != null);
12
12
 
13
13
  if (credentials != null && req.auth.error != null) {
14
- debug('setcookie credentials', credentials);
14
+ console.log('setcookie credentials', credentials);
15
15
  debug('setcookie error', req.auth.error);
16
- debug('logon failed');
17
- return { status: false, error: req.auth.error };
16
+ console.log('Authentication error:', req.auth.error);
17
+ process.exit(0);
18
+ // return { status: false, error: req.auth.error, redirect: '/error' };
18
19
  }
19
20
 
20
21
  // create a cookie(sid) and save credentials in cache
@@ -23,7 +24,7 @@ async function setCookies (req, h, options) {
23
24
  if (options != null) {
24
25
  options.allAppEnv.LOGONPAYLOAD.token = credentials.token;
25
26
  options.allAppEnv.LOGONPAYLOAD.tokenType = 'bearer';
26
- debug(options.allAppEnv.LOGONPAYLOAD);
27
+ // debug(options.allAppEnv.LOGONPAYLOAD);
27
28
  }
28
29
 
29
30