Skip to content

Commit 90e4df9

Browse files
committed
ILogInHandler supports undefined account
1 parent 9d4c019 commit 90e4df9

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/features/auth/domain/log-in/ILogInHandler.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export interface IAccount {
1010
readonly refresh_token?: string
1111
}
1212

13+
export type HandleLoginParams = {
14+
readonly user: IUser
15+
readonly account: IAccount | null | undefined
16+
}
17+
1318
export default interface ILogInHandler {
14-
handleLogIn(params: { user: IUser, account: IAccount | null }): Promise<boolean | string>
19+
handleLogIn(params: HandleLoginParams): Promise<boolean | string>
1520
}

src/features/auth/domain/log-in/LogInHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ILogInHandler, IUser, IAccount } from "."
1+
import { ILogInHandler, IUser, IAccount, HandleLoginParams } from "."
22
import { IOAuthTokenRepository } from "../oauth-token"
33
import saneParseInt from "@/common/utils/saneParseInt"
44

@@ -9,7 +9,7 @@ export default class LogInHandler implements ILogInHandler {
99
this.oauthTokenRepository = config.oauthTokenRepository
1010
}
1111

12-
async handleLogIn({ user, account }: { user: IUser, account: IAccount | null }) {
12+
async handleLogIn({ user, account }: HandleLoginParams) {
1313
if (!account) {
1414
return false
1515
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export type { default as ILogInHandler, IUser, IAccount } from "./ILogInHandler"
1+
export type { default as ILogInHandler, IUser, IAccount, HandleLoginParams } from "./ILogInHandler"
22
export { default as LogInHandler } from "./LogInHandler"

0 commit comments

Comments
 (0)