fix: Improve handling of suspended users signing in with email (#2012)

* chore: Separate signin/auth middleware
fix: Email signin token parsed by JWT middleware
fix: Email signin marked as active when logging in as suspended
fix: Suspended email signin correctly redirected to login screen
closes #1740

* refactor middleware -> lib

* lint
This commit is contained in:
Tom Moor
2021-04-08 20:40:04 -07:00
committed by GitHub
parent 1a889e9913
commit 190f0b6dc5
8 changed files with 96 additions and 109 deletions

View File

@ -1,6 +1,6 @@
// @flow
import { type Context } from "koa";
import { User, Team } from "./models";
import { User } from "./models";
export type ContextWithState = {|
...$Exact<Context>,
@ -10,13 +10,3 @@ export type ContextWithState = {|
authType: "app" | "api",
},
|};
export type ContextWithAuthMiddleware = {|
...$Exact<ContextWithState>,
signIn: (
user: User,
team: Team,
providerName: string,
isFirstSignin: boolean
) => void,
|};