mirror of
https://github.com/lasthead0/yandex2mqtt.git
synced 2025-08-08 09:01:00 +03:00
Release
This commit is contained in:
13
routes/client.js
Normal file
13
routes/client.js
Normal file
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
const passport = require('passport');
|
||||
|
||||
module.exports.info = [
|
||||
passport.authenticate('bearer', { session: false }), (req, res) => {
|
||||
// request.authInfo is set using the `info` argument supplied by
|
||||
// `BearerStrategy`. It is typically used to indicate scope of the token,
|
||||
// and used in access control checks. For illustrative purposes, this
|
||||
// example simply returns the scope in the response.
|
||||
res.json({ client_id: req.user.id, name: req.user.name, scope: req.authInfo.scope });
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user