From 3778f5e7c07394874c443e79bd32350160308e5e Mon Sep 17 00:00:00 2001 From: lesion Date: Sun, 6 Nov 2022 00:18:54 +0100 Subject: [PATCH] minor --- server/api/oauth.js | 51 --------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 server/api/oauth.js diff --git a/server/api/oauth.js b/server/api/oauth.js deleted file mode 100644 index e9091815..00000000 --- a/server/api/oauth.js +++ /dev/null @@ -1,51 +0,0 @@ -// const express = require('express') -// // const OAuthServer = require('express-oauth-server') -// const oauth2orize = require('oauth2orize') -// // const oauth = express.Router() -// // const oauthController = require('./controller/oauth') -// // const OauthClient = require('./models/oauth_client') -// // const log = require('../log') - -// // const oauthServer = oauth2orize.createServer() - -// /* model: oauthController.model, */ -// /* allowEmptyState: true, */ -// /* useErrorHandler: true, */ -// /* continueMiddleware: false, */ -// /* debug: true, */ -// /* requireClientAuthentication: { password: false }, */ -// /* authenticateHandler: { */ -// /* handle (_req, res) { */ -// /* if (!res.locals.user) { */ -// /* throw new Error('Not authenticated!') */ -// /* } */ -// /* return res.locals.user */ -// /* } */ -// /* } */ -// /* }) */ - -// // oauth.oauthServer = oauthServer -// // oauth.use(express.json()) -// // oauth.use(express.urlencoded({ extended: false })) - - -// oauthServer.serializeClient((client, done) => done(null, client.id)) -// oauthServer.deserializeClient(async (id, done) => { -// const client = await OAuthServer.findByPk(id) -// done(null, client) -// }) - - -// oauth.post('/token', oauthController.token) -// oauth.post('/login', oauthController.token) -// oauth.get('/authorize', oauthController.authorize) - -// oauth.use((req, res) => res.sendStatus(404)) - -// oauth.use((err, req, res, next) => { -// const error_msg = err.toString() -// log.warn('[OAUTH USE] ' + error_msg) -// res.status(500).send(error_msg) -// }) - -// module.exports = oauth