Skip to content

Commit

Permalink
Remove usage of AUTH_TYPE
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatakeshi committed Feb 20, 2020
1 parent 5b0c771 commit d14aaa9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cognito/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import AWSAppSyncClient from 'aws-appsync'
import AWS from 'aws-sdk'
import { AuthOptionsOAuth, AUTH_TYPE } from '../shared/types'
import { AuthOptionsOAuth } from '../shared/types'
import { AdminInitiateAuthResponse } from 'aws-sdk/clients/cognitoidentityserviceprovider'
import { getCredentials } from '../utils/cognito'

Expand Down Expand Up @@ -45,7 +45,7 @@ export function createCognitoUserPoolAppSyncClient(options: AWSCognitoUserPoolOp
url: options.url,
region: options.region,
auth: {
type: AUTH_TYPE.AMAZON_COGNITO_USER_POOLS,
type: 'AMAZON_COGNITO_USER_POOLS',
jwtToken: options.auth?.jwtToken(provider, options) ?? jwtToken,
} as AuthOptionsOAuth,
disableOffline: options.disableOffline ?? true,
Expand Down
4 changes: 2 additions & 2 deletions src/iam/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AWSAppSyncClient from 'aws-appsync'
import AWS from 'aws-sdk'
import { AppsyncClientOptions } from '../shared/interfaces'
import { AuthOptionsIAM, AUTH_TYPE } from '../shared/types'
import { AuthOptionsIAM } from '../shared/types'

export interface AWSIAMOptions {
credentials: {
Expand All @@ -22,7 +22,7 @@ export function createIAMAppSyncClient(options: AWSIAMOptions & Omit<AppsyncClie
url: options.url,
region: options.region,
auth: {
type: AUTH_TYPE.AWS_IAM,
type: 'AWS_IAM',
credentials: AWS.config.credentials
} as AuthOptionsIAM,
disableOffline: options.disableOffline ?? true
Expand Down

0 comments on commit d14aaa9

Please sign in to comment.