backend/app/controllers/api/v1/Misc.controller.js
2020-03-01 15:37:52 -06:00

26 lines
655 B
JavaScript

const Controller = require('libflitter/controller/Controller')
const { ObjectId } = require("mongodb");
const Page = require("../../../models/api/Page.model")
/*
* Misc Controller
* -------------------------------------------------------------
* Put some description here!
*/
class Misc extends Controller {
#default_token_grants = ['database']
static get services() {
return [...super.services, 'models']
}
async get_token(req, res, next) {
const Token = this.models.get('api:Token')
const token = await Token.for_user(req.user)
return res.api(token.token)
}
}
module.exports = exports = Misc