File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,27 @@ export default function register($app) {
3030 ) ,
3131 ) ;
3232 }
33- const { payload , options } = req . body ;
34- const jwt = eval ( `require("jsonwebtoken")` ) ;
35- res . set ( 'Content-Type' , 'application/json;charset=utf-8' ) . send ( {
36- token : jwt . sign (
33+ try {
34+ const { payload , options } = req . body ;
35+ const jwt = eval ( `require("jsonwebtoken")` ) ;
36+ const token = jwt . sign (
3737 payload ,
3838 eval ( 'process.env.SUB_STORE_FRONTEND_BACKEND_PATH' ) ,
3939 options ,
40- ) ,
41- } ) ;
40+ ) ;
41+ res . set ( 'Content-Type' , 'application/json;charset=utf-8' ) . send ( {
42+ token,
43+ } ) ;
44+ } catch ( e ) {
45+ return failed (
46+ res ,
47+ new InternalServerError (
48+ 'JWT_SIGN_FAILED' ,
49+ `Failed to sign JWT token` ,
50+ `Reason: ${ e . message ?? e } ` ,
51+ ) ,
52+ ) ;
53+ }
4254 } ) ;
4355
4456 // Storage management
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ if (isLanceX) backend = 'LanceX';
2424if ( isGUIforCores ) backend = 'GUI.for.Cores' ;
2525
2626let meta = { } ;
27+ let feature = { } ;
2728
2829try {
2930 if ( typeof $environment !== 'undefined' ) {
4344 meta . plugin = $Plugin ;
4445 }
4546 if ( isNode ) {
47+ if (
48+ eval ( 'process.env.SUB_STORE_FRONTEND_BACKEND_PATH' ) &&
49+ eval ( 'process.env.SUB_STORE_FRONTEND_PATH' )
50+ ) {
51+ feature . share = true ;
52+ }
4653 meta . node = {
4754 version : eval ( 'process.version' ) ,
4855 argv : eval ( 'process.argv' ) ,
6370export default {
6471 backend,
6572 version : substoreVersion ,
73+ feature,
6674 meta,
6775} ;
You can’t perform that action at this time.
0 commit comments