diff --git a/api/app.js b/api/app.js
index 3e250bf..a751825 100644
--- a/api/app.js
+++ b/api/app.js
@@ -22,7 +22,6 @@ app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "*");
res.header("Access-Control-Allow-Headers", "*");
- res.header("x-powered-by", "serverless-express");
next();
});
@@ -78,9 +77,7 @@ app.get(`/*`, (req, res) => {
*/
app.use(function (err, req, res, next) {
console.error(err);
- res
- .status(500)
- .json({ error: `Internal Serverless Error - "${err.message}"` });
+ res.status(500).json({ error: `Internal Server Error - "${err.message}"` });
});
module.exports = app;
diff --git a/api/config/passport.js b/api/config/passport.js
index fc9389e..3c7adfe 100644
--- a/api/config/passport.js
+++ b/api/config/passport.js
@@ -4,8 +4,8 @@
const StrategyJWT = require("passport-jwt").Strategy;
const ExtractJWT = require("passport-jwt").ExtractJwt;
+
const { users } = require("../models");
-const { comparePassword } = require("../utils");
module.exports = (passport) => {
const options = {};
diff --git a/api/models/users.js b/api/models/users.js
index b73422f..b52870d 100644
--- a/api/models/users.js
+++ b/api/models/users.js
@@ -55,7 +55,6 @@ const register = async (user = {}) => {
* Get user by email address
* @param {string} email
*/
-
const getByEmail = async (email) => {
// Validate
if (!email) {
@@ -86,7 +85,6 @@ const getByEmail = async (email) => {
* Get user by id
* @param {string} id
*/
-
const getById = async (id) => {
// Validate
if (!id) {
diff --git a/package.json b/package.json
index be0e86e..f3e8ed3 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,8 @@
"description": "[](https://www.serverless-fullstack-app.com)",
"main": "index.js",
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "test": "echo \"Error: no test specified\" && exit 1",
+ "format": "prettier --write ."
},
"repository": {
"type": "git",
@@ -14,5 +15,6 @@
"license": "ISC",
"devDependencies": {
"prettier": "2.4.1"
- }
+ },
+ "dependencies": {}
}
diff --git a/site/package.json b/site/package.json
index 02afecf..77f6f82 100644
--- a/site/package.json
+++ b/site/package.json
@@ -11,5 +11,8 @@
"devDependencies": {
"astro": "^0.20.7",
"@astrojs/renderer-react": "^0.2.1"
+ },
+ "dependencies": {
+ "@auth0/auth0-react": "^1.8.0"
}
}
diff --git a/site/src/components/AuthTest.jsx b/site/src/components/AuthTest.jsx
new file mode 100644
index 0000000..69b9bc0
--- /dev/null
+++ b/site/src/components/AuthTest.jsx
@@ -0,0 +1,25 @@
+import React from "react";
+import { Auth0Provider } from "@auth0/auth0-react";
+import LoginButton from "./LoginButton";
+import LogoutButton from "./LogoutButton";
+import Profile from "./Profile";
+import ProfileFromApi from "./ProfileFromApi";
+
+const AuthTest = () => {
+ return (
+
{user.email}
+{user.email}
+{JSON.stringify(userMetadata, null, 2)}
+ ) : (
+ "No user metadata defined"
+ )}
+