review changes #2
Signed-off-by: Ruslan Nasyrov <ruslan.nasyrov.f@gmail.com>
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-plugin-api": "workspace:^",
|
||||
"@backstage/config": "workspace:^",
|
||||
"@backstage/plugin-auth-backend": "workspace:^",
|
||||
"@backstage/plugin-auth-node": "workspace:^",
|
||||
"@backstage/types": "workspace:^",
|
||||
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
PassportOAuthPrivateInfo,
|
||||
} from '@backstage/plugin-auth-node';
|
||||
import { durationToMilliseconds, HumanDuration } from '@backstage/types';
|
||||
import { readDurationFromConfig } from '@backstage/config';
|
||||
|
||||
const HTTP_OPTION_TIMEOUT = 10000;
|
||||
const createHttpOptionsProvider =
|
||||
@@ -88,12 +89,11 @@ export const oidcAuthenticator = createOAuthAuthenticator({
|
||||
);
|
||||
}
|
||||
|
||||
const timeoutHumanDuration = config.getOptional<HumanDuration>('timeout');
|
||||
const timeoutMilliseconds =
|
||||
typeof timeoutHumanDuration === 'object'
|
||||
? durationToMilliseconds(timeoutHumanDuration)
|
||||
: undefined;
|
||||
|
||||
const timeoutMilliseconds = config.has('timeout')
|
||||
? durationToMilliseconds(
|
||||
readDurationFromConfig(config, { key: 'timeout' }),
|
||||
)
|
||||
: undefined;
|
||||
const httpOptionsProvider = createHttpOptionsProvider({
|
||||
timeout: timeoutMilliseconds,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user