Working Auth0 on site

This commit is contained in:
2021-09-28 21:29:15 -05:00
parent d4d904d165
commit 8855709a34
11 changed files with 138 additions and 9 deletions

View File

@@ -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;

View File

@@ -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 = {};

View File

@@ -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) {