Working Auth0 on site
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 = {};
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user