Skip to content

Commit

Permalink
refactor: move internal start url to constants
Browse files Browse the repository at this point in the history
Signed-off-by: nkomonen-amazon <[email protected]>
  • Loading branch information
nkomonen-amazon committed Nov 13, 2024
1 parent 85a202d commit 2a238d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import { asStringifiedStack } from '../shared/telemetry/spans'
import { withTelemetryContext } from '../shared/telemetry/util'
import { DiskCacheError } from '../shared/utilities/cacheUtils'
import { setContext } from '../shared/vscode/setContext'
import { builderIdStartUrl } from './sso/constants'
import { builderIdStartUrl, internalStartUrl } from './sso/constants'

interface AuthService {
/**
Expand Down Expand Up @@ -190,7 +190,7 @@ export class Auth implements AuthService, ConnectionManager {
}

public isInternalAmazonUser(): boolean {
return this.isConnected() && this.startUrl === 'https://amzn.awsapps.com/start'
return this.isConnected() && this.startUrl === internalStartUrl
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/auth/sso/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

export const builderIdStartUrl = 'https://view.awsapps.com/start'
export const internalStartUrl = 'https://amzn.awsapps.com/start'

export const ssoUrlFormatRegex =
/^(https?:\/\/(.+)\.awsapps\.com\/start|https?:\/\/identitycenter\.amazonaws\.com\/ssoins-[\da-zA-Z]{16})\/?$/
Expand Down

0 comments on commit 2a238d4

Please sign in to comment.