@bagelink/sdk 0.0.855 → 0.0.859

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import type { AxiosInstance } from 'axios'
2
2
  // @ts-expect-error - required for axios to work
3
3
  import { axios } from './api'
4
4
 
5
- export interface NewPassword {
5
+ export interface NewPasswordPayload {
6
6
  token: string
7
7
  new_password: string
8
8
  }
@@ -10,11 +10,16 @@ const ax: AxiosInstance = axios
10
10
 
11
11
  ax.interceptors.request.use((config) => {
12
12
  const token = localStorage.getItem('access_token')
13
- if (token !== null && config.headers) { config.headers.Authorization = `Bearer ${token} ` }
13
+ if (token !== null && config.headers) {
14
+ config.headers.Authorization = `Bearer ${token} `
15
+ }
14
16
 
15
17
  const urlParams = new URLSearchParams(window.location.search)
16
18
  const resetToken = urlParams.get('token')
17
- if (resetToken !== null) config.data = { ...config.data, token: resetToken }
19
+
20
+ if (resetToken !== null && config.headers) {
21
+ config.headers.Authorization = `Bearer ${resetToken} `
22
+ }
18
23
  return config
19
24
  })
20
25
 
@@ -39,7 +44,7 @@ export async function passwordRecovery(email?: string) {
39
44
  }
40
45
 
41
46
  export async function resetPassword(
42
- newPassword: Partial<NewPassword> & Pick<NewPassword, 'new_password'>
47
+ newPassword: NewPasswordPayload['new_password']
43
48
  ) {
44
49
  return ax.post('/auth/reset-password', { new_password: newPassword })
45
50
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/sdk",
3
3
  "type": "module",
4
- "version": "0.0.855",
4
+ "version": "0.0.859",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",