Skip to content

Commit d44856d

Browse files
committed
feat: obsolete PostgrestClient.auth()
1 parent 6d90bab commit d44856d

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

src/PostgrestClient.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ export default class PostgrestClient<
4444
this.fetch = fetch
4545
}
4646

47-
/**
48-
* Authenticates the request with JWT.
49-
*
50-
* @param token The JWT token to use.
51-
*
52-
* @deprecated Use `headers` in constructor instead.
53-
*/
54-
auth(token: string): this {
55-
this.headers['Authorization'] = `Bearer ${token}`
56-
return this
57-
}
58-
5947
/**
6048
* Perform a table operation.
6149
*

test/basic.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ describe('custom prefer headers with ', () => {
6868
})
6969
})
7070

71-
test('auth', async () => {
72-
const postgrest = new PostgrestClient<Database>(REST_URL).auth('foo')
73-
expect((postgrest.from('users').select() as any).headers['Authorization']).toEqual('Bearer foo')
74-
})
75-
7671
test('switch schema', async () => {
7772
const postgrest = new PostgrestClient<Database, 'personal'>(REST_URL, { schema: 'personal' })
7873
const res = await postgrest.from('users').select()

0 commit comments

Comments
 (0)