summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/api/prefabs.js
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-16 23:18:02 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-18 15:46:42 +0200
commita6865b86cc8d710374fc0b6cfcbd2b863f1942a9 (patch)
tree121fdb26827c5509a12a4427e8f9d881dbdefe82 /opendc-web/opendc-web-ui/src/api/prefabs.js
parent6412610f38117e1ea0635a56fa023183723fa67a (diff)
ui: Migrate to Auth0 as Identity Provider
This change updates the frontend codebase to move away from the Google login and instead use Auth0 as generic Identity Provider. This allows users to login with other accounts as well. Since Auth0 has a free tier, users can experiment themselves with OpenDC locally without having to pay for the login functionality. The code has been written so that we should be able to migrate away from Auth0 once it is not a suitable Identity Provider for OpenDC anymore.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/api/prefabs.js')
-rw-r--r--opendc-web/opendc-web-ui/src/api/prefabs.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/opendc-web/opendc-web-ui/src/api/prefabs.js b/opendc-web/opendc-web-ui/src/api/prefabs.js
index a8bd3f3b..eb9aa23c 100644
--- a/opendc-web/opendc-web-ui/src/api/prefabs.js
+++ b/opendc-web/opendc-web-ui/src/api/prefabs.js
@@ -22,18 +22,18 @@
import { request } from './index'
-export function getPrefab(prefabId) {
- return request(`prefabs/${prefabId}`)
+export function getPrefab(auth, prefabId) {
+ return request(auth, `prefabs/${prefabId}`)
}
-export function addPrefab(prefab) {
- return request('prefabs', 'POST', { prefab })
+export function addPrefab(auth, prefab) {
+ return request(auth, 'prefabs/', 'POST', { prefab })
}
-export function updatePrefab(prefab) {
- return request(`prefabs/${prefab._id}`, 'PUT', { prefab })
+export function updatePrefab(auth, prefab) {
+ return request(auth, `prefabs/${prefab._id}`, 'PUT', { prefab })
}
-export function deletePrefab(prefabId) {
- return request(`prefabs/${prefabId}`, 'DELETE')
+export function deletePrefab(auth, prefabId) {
+ return request(auth, `prefabs/${prefabId}`, 'DELETE')
}