chore: Move to prettier standard double quotes (#1309)
This commit is contained in:
@@ -1,38 +1,38 @@
|
||||
// @flow
|
||||
import bodyParser from 'koa-bodyparser';
|
||||
import Koa from 'koa';
|
||||
import Router from 'koa-router';
|
||||
import validation from '../middlewares/validation';
|
||||
import auth from '../middlewares/authentication';
|
||||
import addMonths from 'date-fns/add_months';
|
||||
import { Team } from '../models';
|
||||
import { getCookieDomain } from '../../shared/utils/domains';
|
||||
import bodyParser from "koa-bodyparser";
|
||||
import Koa from "koa";
|
||||
import Router from "koa-router";
|
||||
import validation from "../middlewares/validation";
|
||||
import auth from "../middlewares/authentication";
|
||||
import addMonths from "date-fns/add_months";
|
||||
import { Team } from "../models";
|
||||
import { getCookieDomain } from "../../shared/utils/domains";
|
||||
|
||||
import slack from './slack';
|
||||
import google from './google';
|
||||
import email from './email';
|
||||
import slack from "./slack";
|
||||
import google from "./google";
|
||||
import email from "./email";
|
||||
|
||||
const app = new Koa();
|
||||
const router = new Router();
|
||||
|
||||
router.use('/', slack.routes());
|
||||
router.use('/', google.routes());
|
||||
router.use('/', email.routes());
|
||||
router.use("/", slack.routes());
|
||||
router.use("/", google.routes());
|
||||
router.use("/", email.routes());
|
||||
|
||||
router.get('/redirect', auth(), async ctx => {
|
||||
router.get("/redirect", auth(), async ctx => {
|
||||
const user = ctx.state.user;
|
||||
|
||||
// transfer access token cookie from root to subdomain
|
||||
const rootToken = ctx.cookies.get('accessToken');
|
||||
const rootToken = ctx.cookies.get("accessToken");
|
||||
const jwtToken = user.getJwtToken();
|
||||
|
||||
if (rootToken === jwtToken) {
|
||||
ctx.cookies.set('accessToken', undefined, {
|
||||
ctx.cookies.set("accessToken", undefined, {
|
||||
httpOnly: true,
|
||||
domain: getCookieDomain(ctx.request.hostname),
|
||||
});
|
||||
|
||||
ctx.cookies.set('accessToken', jwtToken, {
|
||||
ctx.cookies.set("accessToken", jwtToken, {
|
||||
httpOnly: false,
|
||||
expires: addMonths(new Date(), 3),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user