Move api to v1 folder
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
import auth0 from "../../lib/auth0";
|
||||
import { withErrorHandling } from "../../lib/apiHelpers";
|
||||
|
||||
export default callback = withErrorHandling(async (req, res) => {
|
||||
await auth0.handleCallback(req, res);
|
||||
});
|
||||
@@ -1,6 +0,0 @@
|
||||
import auth0 from "../../lib/auth0";
|
||||
import { withErrorHandling } from "../../lib/apiHelpers";
|
||||
|
||||
export default login = withErrorHandling(async (req, res) => {
|
||||
await auth0.handleLogin(req, res);
|
||||
});
|
||||
@@ -1,6 +0,0 @@
|
||||
import auth0 from "../../lib/auth0";
|
||||
import { withErrorHandling } from "../../lib/apiHelpers";
|
||||
|
||||
export default logout = withErrorHandling(async (req, res) => {
|
||||
await auth0.handleLogout(req, res);
|
||||
});
|
||||
@@ -1,6 +0,0 @@
|
||||
import auth0 from "../../lib/auth0";
|
||||
import { withErrorHandling } from "../../lib/apiHelpers";
|
||||
|
||||
export default me = withErrorHandling(async (req, res) => {
|
||||
await auth0.handleProfile(req, res);
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
import db from "../../lib/db";
|
||||
import db from "../../../lib/db";
|
||||
import Ajv from "ajv";
|
||||
import addFormats from "ajv-formats";
|
||||
import { withErrorHandling } from "../../lib/apiHelpers";
|
||||
import { withErrorHandling } from "../../../lib/apiHelpers";
|
||||
|
||||
const handler = withErrorHandling(async (req, res) => {
|
||||
const { method } = req;
|
||||
8
web/pages/api/v1/callback.js
Normal file
8
web/pages/api/v1/callback.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import auth0 from "../../../lib/auth0";
|
||||
import { withErrorHandling } from "../../../lib/apiHelpers";
|
||||
|
||||
const callback = withErrorHandling(async (req, res) => {
|
||||
await auth0.handleCallback(req, res);
|
||||
});
|
||||
|
||||
export default callback;
|
||||
@@ -1,5 +1,5 @@
|
||||
import db from "../../lib/db";
|
||||
import { withErrorHandling } from "../../lib/apiHelpers";
|
||||
import db from "../../../lib/db";
|
||||
import { withErrorHandling } from "../../../lib/apiHelpers";
|
||||
|
||||
const handler = withErrorHandling(async (req, res) => {
|
||||
const { method } = req;
|
||||
8
web/pages/api/v1/login.js
Normal file
8
web/pages/api/v1/login.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import auth0 from "../../../lib/auth0";
|
||||
import { withErrorHandling } from "../../../lib/apiHelpers";
|
||||
|
||||
const login = withErrorHandling(async (req, res) => {
|
||||
await auth0.handleLogin(req, res);
|
||||
});
|
||||
|
||||
export default login;
|
||||
8
web/pages/api/v1/logout.js
Normal file
8
web/pages/api/v1/logout.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import auth0 from "../../../lib/auth0";
|
||||
import { withErrorHandling } from "../../../lib/apiHelpers";
|
||||
|
||||
const logout = withErrorHandling(async (req, res) => {
|
||||
await auth0.handleLogout(req, res);
|
||||
});
|
||||
|
||||
export default logout;
|
||||
8
web/pages/api/v1/me.js
Normal file
8
web/pages/api/v1/me.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import auth0 from "../../../lib/auth0";
|
||||
import { withErrorHandling } from "../../../lib/apiHelpers";
|
||||
|
||||
const me = withErrorHandling(async (req, res) => {
|
||||
await auth0.handleProfile(req, res);
|
||||
});
|
||||
|
||||
export default me;
|
||||
Reference in New Issue
Block a user