Skip to content

Commit

Permalink
chore: fix auth for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pviti committed May 23, 2024
1 parent 8fd047f commit 4d2cb43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/token.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { authentication } from '@commercelayer/js-auth'
import { authenticate } from '@commercelayer/js-auth'
import dotenv from 'dotenv'

dotenv.config()
Expand Down Expand Up @@ -77,17 +77,17 @@ const getAccessToken = async (auth: AuthData): Promise<AccessToken> => {
const credentials: any = {
clientId: auth.clientId,
clientSecret: auth.clientSecret,
slug: auth.slug,
// slug: auth.slug,
domain: auth.domain || undefined,
scope
}

if (auth.email && auth.password) {
credentials.username = auth.email
credentials.password = auth.password
return authentication('password', credentials)
return authenticate('password', credentials)
}

return authentication('client_credentials', credentials)
return authenticate('client_credentials', credentials)

}

0 comments on commit 4d2cb43

Please sign in to comment.