use oauth2 password flow for webclient
This commit is contained in:
@@ -10,6 +10,7 @@ const oauthServer = new OAuthServer({
|
||||
useErrorHandler: true,
|
||||
continueMiddleware: false,
|
||||
debug: true,
|
||||
requireClientAuthentication: { password: false },
|
||||
authenticateHandler: {
|
||||
handle (req) {
|
||||
if (!req.user) {
|
||||
@@ -25,9 +26,12 @@ oauth.use(express.json())
|
||||
oauth.use(express.urlencoded({ extended: false }))
|
||||
|
||||
oauth.post('/token', oauthServer.token())
|
||||
oauth.post('/login', oauthServer.token())
|
||||
|
||||
oauth.get('/authorize', oauthServer.authorize())
|
||||
|
||||
oauth.use((req, res) => res.sendStatus(404))
|
||||
|
||||
oauth.use((err, req, res, next) => {
|
||||
const error_msg = err.toString()
|
||||
debug(err)
|
||||
|
||||
Reference in New Issue
Block a user