@bagelink/sdk 0.0.740 → 0.0.744

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.
@@ -23,23 +23,22 @@ ax.interceptors.request.use((config) => {
23
23
  })
24
24
 
25
25
  export async function login(username: string, password: string) {
26
- const formData = new FormData()
27
- formData.append('username', username)
28
- formData.append('password', password)
29
- formData.append('scope', 'auth')
30
- formData.append('grant_type', 'password')
31
- const { data } = await ax.post('/auth/login', formData, {
32
- headers: { 'withCredentials': true, 'Content-Type': 'multipart/form-data' },
33
- })
26
+ const { data } = await ax.post(
27
+ '/auth/login',
28
+ { username, password }
29
+ )
34
30
  localStorage.setItem('access_token', data.access_token)
35
31
  }
32
+
36
33
  export function logout() {
37
34
  localStorage.removeItem('access_token')
38
35
  window.location.reload()
39
36
  }
37
+
40
38
  export async function passwordRecovery(email?: string): Promise<AxiosResponse<Message>> {
41
39
  return ax.post(`/auth/password-recovery/${email}`, {})
42
40
  }
41
+
43
42
  export async function resetPassword(
44
43
  newPassword: Partial<NewPassword> & Pick<NewPassword, 'new_password'>
45
44
  ): Promise<AxiosResponse<Record<string, any>>> {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/sdk",
3
3
  "type": "module",
4
- "version": "0.0.740",
4
+ "version": "0.0.744",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",