diff --git a/client/src/components/Apps/AppForm/AppForm.tsx b/client/src/components/Apps/AppForm/AppForm.tsx index bdfa170..0b94465 100644 --- a/client/src/components/Apps/AppForm/AppForm.tsx +++ b/client/src/components/Apps/AppForm/AppForm.tsx @@ -61,7 +61,7 @@ export const AppForm = ({ app, modalHandler }: Props): JSX.Element => { } data.append('name', formData.name); data.append('url', formData.url); - data.append('isPublic', `${formData.isPublic}`); + data.append('isPublic', `${formData.isPublic ? 1 : 0}`); return data; }; diff --git a/client/src/components/Bookmarks/Form/BookmarksForm.tsx b/client/src/components/Bookmarks/Form/BookmarksForm.tsx index e5f790b..f0a3a43 100644 --- a/client/src/components/Bookmarks/Form/BookmarksForm.tsx +++ b/client/src/components/Bookmarks/Form/BookmarksForm.tsx @@ -77,7 +77,7 @@ export const BookmarksForm = ({ data.append('name', formData.name); data.append('url', formData.url); data.append('categoryId', `${formData.categoryId}`); - data.append('isPublic', `${formData.isPublic}`); + data.append('isPublic', `${formData.isPublic ? 1 : 0}`); return data; }; diff --git a/client/src/utility/applyAuth.ts b/client/src/utility/applyAuth.ts index cf79efe..8ec0776 100644 --- a/client/src/utility/applyAuth.ts +++ b/client/src/utility/applyAuth.ts @@ -1,4 +1,4 @@ export const applyAuth = () => { const token = localStorage.getItem('token') || ''; - return { Authorization_Flame: `Bearer ${token}` }; + return { 'Authorization-Flame': `Bearer ${token}` }; }; diff --git a/middleware/auth.js b/middleware/auth.js index 137c78d..334eeeb 100644 --- a/middleware/auth.js +++ b/middleware/auth.js @@ -1,7 +1,7 @@ const jwt = require('jsonwebtoken'); const auth = (req, res, next) => { - const authHeader = req.header('Authorization_Flame'); + const authHeader = req.header('Authorization-Flame'); let token; let tokenIsValid = false;