File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -61,16 +61,19 @@ export class MongoCredentials {
61
61
this . mechanismProperties = options . mechanismProperties || { } ;
62
62
63
63
if ( this . mechanism . match ( / M O N G O D B - A W S / i) ) {
64
- if ( this . username == null && process . env . AWS_ACCESS_KEY_ID ) {
64
+ if ( ! this . username && process . env . AWS_ACCESS_KEY_ID ) {
65
65
this . username = process . env . AWS_ACCESS_KEY_ID ;
66
66
}
67
67
68
- if ( this . password == null && process . env . AWS_SECRET_ACCESS_KEY ) {
68
+ if ( ! this . password && process . env . AWS_SECRET_ACCESS_KEY ) {
69
69
this . password = process . env . AWS_SECRET_ACCESS_KEY ;
70
70
}
71
71
72
- if ( this . mechanismProperties . AWS_SESSION_TOKEN == null && process . env . AWS_SESSION_TOKEN ) {
73
- this . mechanismProperties . AWS_SESSION_TOKEN = process . env . AWS_SESSION_TOKEN ;
72
+ if ( ! this . mechanismProperties . AWS_SESSION_TOKEN && process . env . AWS_SESSION_TOKEN ) {
73
+ this . mechanismProperties = {
74
+ ...this . mechanismProperties ,
75
+ AWS_SESSION_TOKEN : process . env . AWS_SESSION_TOKEN
76
+ } ;
74
77
}
75
78
}
76
79
You can’t perform that action at this time.
0 commit comments