This repository was archived by the owner on Mar 9, 2021. It is now read-only.
File tree 3 files changed +15
-2
lines changed
3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " coderplex-app" ,
3
+ "alias" : " coderplex-app.now.sh"
4
+ }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const rest = require('feathers-rest/client');
9
9
10
10
const baseUrl =
11
11
process . env . NODE_ENV === 'production' || process . env . WITH_API
12
- ? `https://api. coderplex.org`
12
+ ? `https://coderplex.org/api `
13
13
: 'http://localhost:4000' ;
14
14
15
15
const dev = process . env . NODE_ENV !== 'production' ;
53
53
// Get loggedIn user
54
54
server . use ( async ( req , res , next ) => {
55
55
const token = req . cookies [ 'feathers-jwt' ] ;
56
+ console . log ( '****token****' ) ;
57
+ console . log ( token ) ;
58
+ console . log ( '****token****' ) ;
56
59
if ( ! token ) return next ( ) ;
57
60
try {
58
61
const { userId } = await feathersClient . passport . verifyJWT ( token ) ;
62
+ console . log ( '****USERID****' ) ;
63
+ console . log ( userId ) ;
64
+ console . log ( '****USERID****' ) ;
59
65
req . user = await fetch ( `${ baseUrl } /users/${ userId } ` , {
60
66
headers : {
61
67
Authorization : `${ token } ` ,
62
68
} ,
63
69
} ) . then ( res => res . json ( ) ) ;
70
+ console . log ( '****ServerUSER****' ) ;
71
+ console . log ( req . user ) ;
72
+ console . log ( '****ServerUSER****' ) ;
64
73
next ( ) ;
65
74
} catch ( error ) {
66
75
console . error ( error ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import rest from 'feathers-rest/client';
6
6
7
7
const baseUrl =
8
8
process . env . NODE_ENV === 'production' || process . env . WITH_API
9
- ? `https://api. coderplex.org`
9
+ ? `https://coderplex.org/api `
10
10
: 'http://localhost:4000' ;
11
11
12
12
const client = feathers ( ) ;
You can’t perform that action at this time.
0 commit comments