File tree 5 files changed +10
-7
lines changed
5 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const CancelToken = axios.CancelToken;
4
4
const source = CancelToken . source ( ) ;
5
5
6
6
const axiosInstance = axios . create ( {
7
- baseURL : 'http://localhost:3000/ api/v1' ,
7
+ baseURL : ` ${ process . env . BASE_URL } / api/v1` ,
8
8
cancelToken : source . token
9
9
} )
10
10
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ function CallBack(props) {
11
11
} )
12
12
13
13
return (
14
- < BaseLayout >
14
+ < BaseLayout title = "Redirecting..." >
15
15
< BasePage >
16
16
< p > VERIFYING DATA ...</ p >
17
17
</ BasePage >
Original file line number Diff line number Diff line change @@ -44,10 +44,10 @@ function portfolioNew(props) {
44
44
} )
45
45
. catch ( err => {
46
46
setSubmitting ( false ) ;
47
- setError ( err . message ) ;
47
+ setError ( err ) ;
48
48
Swal . fire (
49
49
'Failed' ,
50
- err . message ,
50
+ err ,
51
51
'error'
52
52
) ;
53
53
} ) ;
Original file line number Diff line number Diff line change 3
3
// }
4
4
5
5
module . exports = {
6
- DB_URI : process . env . DB_URI
6
+ DB_URI : process . env . DB_URI ,
7
+ NAMESPACE : 'https://anavas.herokuapp.com'
7
8
}
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ const jwt = require('express-jwt');
2
2
const { expressJwtSecret } = require ( 'jwks-rsa' ) ;
3
3
const jwtAuthz = require ( 'express-jwt-authz' ) ;
4
4
5
- const namespace = process . env . NAMESPACE ;
5
+ const config = require ( '../config' ) ;
6
+
7
+ const namespace = config . NAMESPACE ;
6
8
7
9
//Web token validado
8
10
exports . jwtCheck = jwt ( {
@@ -23,7 +25,7 @@ exports.checkScopes = jwtAuthz(['read:portfolios'])
23
25
//Check Role
24
26
exports . checkRole = role => ( req , res , next ) => {
25
27
const user = req . user
26
- if ( user && ( user [ `${ namespace } /role` ] === role ) ) {
28
+ if ( user && user [ ` ${ namespace } /role` ] && ( user [ `${ namespace } /role` ] === role ) ) {
27
29
next ( ) ;
28
30
} else {
29
31
return res . status ( 401 ) . send ( { title : 'Not Authorized' , detail : 'You are not authorized to access to this data' } )
You can’t perform that action at this time.
0 commit comments