File tree Expand file tree Collapse file tree 9 files changed +19
-21
lines changed Expand file tree Collapse file tree 9 files changed +19
-21
lines changed Original file line number Diff line number Diff line change 39
39
"access" : " public"
40
40
},
41
41
"dependencies" : {
42
+ "@feathersjs/authentication" : " ^4.3.2" ,
42
43
"@feathersjs/commons" : " ^4.3.0" ,
43
44
"@feathersjs/errors" : " ^4.3.2" ,
45
+ "@feathersjs/feathers" : " ^4.3.2" ,
44
46
"debug" : " ^4.1.1"
45
47
},
46
48
"devDependencies" : {
47
- "@feathersjs/authentication" : " ^4.3.2" ,
48
49
"@feathersjs/authentication-local" : " ^4.3.2" ,
49
50
"@feathersjs/express" : " ^4.3.2" ,
50
- "@feathersjs/feathers" : " ^4.3.2" ,
51
51
"@feathersjs/primus" : " ^4.3.2" ,
52
52
"@feathersjs/primus-client" : " ^4.3.2" ,
53
53
"@feathersjs/rest-client" : " ^4.3.2" ,
Original file line number Diff line number Diff line change 39
39
"access" : " public"
40
40
},
41
41
"dependencies" : {
42
+ "@feathersjs/authentication" : " ^4.3.2" ,
42
43
"@feathersjs/errors" : " ^4.3.2" ,
44
+ "@feathersjs/feathers" : " ^4.3.2" ,
43
45
"bcryptjs" : " ^2.4.3" ,
44
46
"debug" : " ^4.1.1" ,
45
47
"lodash" : " ^4.17.15"
46
48
},
47
49
"devDependencies" : {
48
- "@feathersjs/authentication" : " ^4.3.2" ,
49
- "@feathersjs/feathers" : " ^4.3.2" ,
50
50
"@types/bcryptjs" : " ^2.4.2" ,
51
51
"@types/debug" : " ^4.1.5" ,
52
52
"@types/lodash" : " ^4.14.137" ,
Original file line number Diff line number Diff line change 42
42
"@feathersjs/authentication" : " ^4.3.2" ,
43
43
"@feathersjs/errors" : " ^4.3.2" ,
44
44
"@feathersjs/express" : " ^4.3.2" ,
45
+ "@feathersjs/feathers" : " ^4.3.2" ,
45
46
"debug" : " ^4.1.1" ,
46
47
"express-session" : " ^1.16.2" ,
47
48
"grant" : " ^4.6.2" ,
48
49
"grant-profile" : " ^0.0.5" ,
49
50
"lodash" : " ^4.17.15"
50
51
},
51
52
"devDependencies" : {
52
- "@feathersjs/feathers" : " ^4.3.2" ,
53
53
"@types/debug" : " ^4.1.5" ,
54
54
"@types/express" : " ^4.17.1" ,
55
55
"@types/express-session" : " ^1.15.14" ,
Original file line number Diff line number Diff line change @@ -24,21 +24,21 @@ export const setup = (options: OauthSetupSettings) => (app: Application) => {
24
24
}
25
25
26
26
const { strategyNames } = service ;
27
-
27
+
28
28
// Set up all the defaults
29
29
const { path = '/oauth' } = oauth . defaults || { } ;
30
30
const port = app . get ( 'port' ) ;
31
31
let host = app . get ( 'host' ) ;
32
32
let protocol = 'https' ;
33
-
33
+
34
34
// Development environments commonly run on HTTP with an extended port
35
35
if ( app . get ( 'env' ) === 'development' ) {
36
36
protocol = 'http' ;
37
37
if ( String ( port ) !== '80' ) {
38
38
host += ':' + port ;
39
39
}
40
40
}
41
-
41
+
42
42
const grant = merge ( {
43
43
defaults : {
44
44
path,
@@ -47,7 +47,7 @@ export const setup = (options: OauthSetupSettings) => (app: Application) => {
47
47
transport : 'session'
48
48
}
49
49
} , omit ( oauth , 'redirect' ) ) ;
50
-
50
+
51
51
const getUrl = ( url : string ) => {
52
52
const { defaults } = grant ;
53
53
return `${ defaults . protocol } ://${ defaults . host } ${ path } /${ url } ` ;
Original file line number Diff line number Diff line change 40
40
},
41
41
"dependencies" : {
42
42
"@feathersjs/errors" : " ^4.3.2" ,
43
+ "@feathersjs/feathers" : " ^4.3.2" ,
43
44
"@feathersjs/transport-commons" : " ^4.3.2" ,
44
45
"debug" : " ^4.1.1" ,
45
46
"jsonwebtoken" : " ^8.5.1" ,
48
49
"uuid" : " ^3.3.2"
49
50
},
50
51
"devDependencies" : {
51
- "@feathersjs/feathers" : " ^4.3.2" ,
52
52
"@types/debug" : " ^4.1.5" ,
53
53
"@types/jsonwebtoken" : " ^8.3.3" ,
54
54
"@types/lodash" : " ^4.14.137" ,
Original file line number Diff line number Diff line change @@ -92,15 +92,15 @@ export class AuthenticationService extends AuthenticationBase implements Partial
92
92
93
93
debug ( 'Got authentication result' , authResult ) ;
94
94
95
+ if ( authResult . accessToken ) {
96
+ return authResult ;
97
+ }
98
+
95
99
const [ payload , jwtOptions ] = await Promise . all ( [
96
100
this . getPayload ( authResult , params ) ,
97
101
this . getTokenOptions ( authResult , params )
98
102
] ) ;
99
103
100
- if ( authResult . accessToken ) {
101
- return authResult ;
102
- }
103
-
104
104
debug ( 'Creating JWT with' , payload , jwtOptions ) ;
105
105
106
106
const accessToken = await this . createAccessToken ( payload , jwtOptions , params . secret ) ;
Original file line number Diff line number Diff line change 44
44
"access" : " public"
45
45
},
46
46
"dependencies" : {
47
+ "@feathersjs/feathers" : " ^4.3.2" ,
47
48
"config" : " ^3.2.2" ,
48
49
"debug" : " ^4.1.1"
49
50
},
50
51
"devDependencies" : {
51
- "@feathersjs/feathers" : " ^4.3.2" ,
52
52
"@types/config" : " ^0.0.34" ,
53
53
"@types/debug" : " ^4.1.5" ,
54
54
"@types/mocha" : " ^5.2.7" ,
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const debug = Debug('@feathersjs/configuration');
7
7
const separator = path . sep ;
8
8
9
9
export default function init ( ) {
10
- return ( app : Application | undefined ) => {
10
+ return ( app ? : Application ) => {
11
11
const convert = ( current : any ) => {
12
12
const result : { [ key : string ] : any } = Array . isArray ( current ) ? [ ] : { } ;
13
13
@@ -53,7 +53,7 @@ export default function init () {
53
53
Object . keys ( conf ) . forEach ( name => {
54
54
const value = conf [ name ] ;
55
55
debug ( `Setting ${ name } configuration value to` , value ) ;
56
- ( app as Application ) . set ( name , value ) ;
56
+ app ! . set ( name , value ) ;
57
57
} ) ;
58
58
59
59
return conf ;
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ const application = {
70
70
const current = this . services [ location ] ;
71
71
72
72
if ( typeof current === 'undefined' && typeof this . defaultService === 'function' ) {
73
- return this . use ( `/ ${ location } ` , this . defaultService ( location ) )
73
+ return this . use ( location , this . defaultService ( location ) )
74
74
. service ( location ) ;
75
75
}
76
76
@@ -84,9 +84,7 @@ const application = {
84
84
85
85
const location = stripSlashes ( path ) || '/' ;
86
86
const isSubApp = typeof service . service === 'function' && service . services ;
87
- const isService = this . methods . concat ( 'setup' ) . some ( name =>
88
- ( service && typeof service [ name ] === 'function' )
89
- ) ;
87
+ const isService = this . methods . concat ( 'setup' ) . some ( name => typeof service [ name ] === 'function' ) ;
90
88
91
89
if ( isSubApp ) {
92
90
const subApp = service ;
You can’t perform that action at this time.
0 commit comments