const Router = require('@koa/router');
const joi = require('joi');
const commonCtrl = require('src/controllers/common/index.js');
const accCtrl = require('src/controllers/account/v1/index.js');

const r = new Router({ prefix: '/account' });
module.exports = r;

/**
 * get account info
 * @swagger
 * @route GET /api/v1/account/login/sso
 * @group account - account apis
 * @param {string} back_url.query.required - back to url
 * @returns {RespDefault.model} default -
 */
r.get(
  '/login/sso',
  commonCtrl.validate({
    query: {
      back_url: joi.string().required(),
    },
  }),
  accCtrl.loginSSO()
);
