backend/app/controllers/api/v1/Session.controller.js

27 lines
625 B
JavaScript
Raw Normal View History

const { Controller } = require('libflitter')
class SessionController extends Controller {
static get services() {
return [...super.services, 'configs']
}
async get_session(req, res, next) {
return res.api(await this.session_data(req.user))
}
async session_data(user) {
return {
user: {
id: user.id,
username: user.uid,
},
app: {
name: this.configs.get('app.name'),
url: this.configs.get('app.url'),
},
}
}
}
module.exports = exports = SessionController