musora-content-services 2.123.0 → 2.123.1

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.123.1](https://github.com/railroadmedia/musora-content-services/compare/v2.123.0...v2.123.1) (2026-01-28)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **auth:** use http client for auth functions ([#751](https://github.com/railroadmedia/musora-content-services/issues/751)) ([6958adc](https://github.com/railroadmedia/musora-content-services/commit/6958adc87689a7dd433a8c66ccaff60317e6e962))
11
+
5
12
  ## [2.123.0](https://github.com/railroadmedia/musora-content-services/compare/v2.122.7...v2.123.0) (2026-01-28)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.123.0",
3
+ "version": "2.123.1",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @module Sessions
3
3
  */
4
+ import { DELETE, POST } from '../../infrastructure/http/HttpClient.js'
4
5
  import { globalConfig } from '../config.js'
5
6
  import { clearAllCachedData } from '../dataContext.js'
6
7
  import { setUserPinnedProgressRow } from '../progress-row/base.js'
@@ -31,28 +32,15 @@ const excludeFromGeneratedIndex = []
31
32
  */
32
33
  export async function login(email, password, deviceName, deviceToken, platform) {
33
34
  const baseUrl = `${globalConfig.baseUrl}/api/user-management-system`
34
- const res = await fetch(`${baseUrl}/v1/sessions`, {
35
- method: 'POST',
36
- headers: {
37
- 'X-Client-Platform': globalConfig.isMA ? 'mobile' : 'web',
38
- 'Content-Type': 'application/json',
39
- Authorization: null,
40
- },
41
- body: JSON.stringify({
42
- email: email,
43
- password: password,
44
- device_name: deviceName,
45
- device_token: deviceToken,
46
- platform: platform,
47
- }),
35
+ const data = await POST(`${baseUrl}/v1/sessions`, {
36
+ email: email,
37
+ password: password,
38
+ device_name: deviceName,
39
+ device_token: deviceToken,
40
+ platform: platform,
48
41
  })
49
42
 
50
- const data = await res.json()
51
-
52
- // TODO: refactor this. I don't think this is the place for it but we need it fixed for the system test
53
- if (res.ok) {
54
- await setUserPinnedProgressRow(data.user?.id, data.user?.brand_pinned_progress || {})
55
- }
43
+ await setUserPinnedProgressRow(data.user?.id, data.user?.brand_pinned_progress || {})
56
44
 
57
45
  return data
58
46
  }
@@ -100,13 +88,7 @@ export async function login(email, password, deviceName, deviceToken, platform)
100
88
  */
101
89
  export async function logout() {
102
90
  const baseUrl = `${globalConfig.baseUrl}/api/user-management-system`
103
- await fetch(`${baseUrl}/v1/sessions`, {
104
- method: 'DELETE',
105
- headers: {
106
- Authorization: `Bearer ${globalConfig.sessionConfig.authToken}`,
107
- 'Content-Type': 'application/json',
108
- },
109
- })
91
+ await DELETE(`${baseUrl}/v1/sessions`)
110
92
 
111
93
  // Clear all locally cached data to prevent data leakage between users
112
94
  await clearAllCachedData()
@@ -162,6 +144,6 @@ export async function generateAuthSessionUrl(userId, redirectTo) {
162
144
 
163
145
  return `${absoluteRedirectTo.origin}/auth?${params.toString()}`
164
146
  } else {
165
- throw new Error('Not implemented - MA deep links don\'t accept auth keys')
147
+ throw new Error("Not implemented - MA deep links don't accept auth keys")
166
148
  }
167
149
  }