diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-13 11:44:39 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-13 11:44:39 +0900 |
| commit | e2e7babee0de35385eb74830c82eaccdb28f013a (patch) | |
| tree | f86755ab4c60ae63e43039945a07a7ce09bc7a8e /src/server/api/common | |
| parent | wip (diff) | |
| download | sharkey-e2e7babee0de35385eb74830c82eaccdb28f013a.tar.gz sharkey-e2e7babee0de35385eb74830c82eaccdb28f013a.tar.bz2 sharkey-e2e7babee0de35385eb74830c82eaccdb28f013a.zip | |
wip
Diffstat (limited to 'src/server/api/common')
| -rw-r--r-- | src/server/api/common/signin.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/api/common/signin.ts b/src/server/api/common/signin.ts index f57c38414c..44e1336f27 100644 --- a/src/server/api/common/signin.ts +++ b/src/server/api/common/signin.ts @@ -3,7 +3,7 @@ import * as Koa from 'koa'; import config from '../../../config'; import { ILocalUser } from '../../../models/user'; -export default function(ctx: Koa.Context, user: ILocalUser, redirect: boolean) { +export default function(ctx: Koa.Context, user: ILocalUser, redirect = false) { const expires = 1000 * 60 * 60 * 24 * 365; // One Year ctx.cookies.set('i', user.token, { path: '/', @@ -16,5 +16,7 @@ export default function(ctx: Koa.Context, user: ILocalUser, redirect: boolean) { if (redirect) { ctx.redirect(config.url); + } else { + ctx.status = 204; } } |