Skip to content

Commit

Permalink
Create client session with api key
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Aug 5, 2024
1 parent 04e5473 commit 763d9c2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/seam/connect/client-session-token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,21 @@ test('SeamHttp: updateClientSessionToken returns instance authorized with a new
const seam = SeamHttp.fromClientSessionToken(seed.seam_cst1_token, {
endpoint,
})
const { token } = await seam.clientSessions.create({

const devices = await seam.devices.list()
t.true(devices.length > 0)

const seamUsingApiKey = SeamHttp.fromApiKey(seed.seam_apikey2_token, {
endpoint,
})

const { token } = await seamUsingApiKey.clientSessions.create({
user_identifier_key: 'some-new-user-identifier-key',
})

await seam.updateClientSessionToken(token)
const devices = await seam.devices.list()
t.is(devices.length, 0)
const devicesFromNewSession = await seam.devices.list()
t.is(devicesFromNewSession.length, 0)
})

test('SeamHttp: updateClientSessionToken fails if no existing clientSessionToken', async (t) => {
Expand Down

0 comments on commit 763d9c2

Please sign in to comment.