@campxdev/shared 1.1.3 → 1.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -9,7 +9,7 @@ import { PermissionsStore, AssetsStore, UserStore } from '../shared-state'
9
9
  const url = window.location.origin
10
10
 
11
11
  type AuthParams = {
12
- serviceKey: string
12
+ permissionsEndpoint: string
13
13
  loginUrl?: string
14
14
  }
15
15
 
@@ -27,7 +27,7 @@ type AuthResponse = {
27
27
  }
28
28
  }
29
29
 
30
- function useAuth({ serviceKey, loginUrl }: AuthParams): AuthResponse {
30
+ function useAuth({ permissionsEndpoint, loginUrl }: AuthParams): AuthResponse {
31
31
  const { openLoginForm } = useLoginForm()
32
32
  const [loading, setLoading] = useState<boolean>(false)
33
33
  const [data, setData] = useState(null)
@@ -35,7 +35,7 @@ function useAuth({ serviceKey, loginUrl }: AuthParams): AuthResponse {
35
35
  const appInit = async () => {
36
36
  setLoading(true)
37
37
  axios
38
- .get(serviceKey + '/my-permissions')
38
+ .get(permissionsEndpoint)
39
39
  .then((res) => {
40
40
  setLoading(false)
41
41
  setData(res.data)