Skip to content

Commit

Permalink
認証に使用するインターフェースの名前を変更した。
Browse files Browse the repository at this point in the history
  • Loading branch information
eigoninaritai-naokichi committed Jan 16, 2024
1 parent 49ca211 commit 4a1f2c2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions app/actions/authentication/user-registration-action.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import IUserRegistrar from "../../libraries/authentication/i-user-registrar";
import IAuthenticationUserRegistrar from "../../libraries/authentication/i-authentication-user-registrar";
import SignUpResponse from "../../models/authentication/signup-response";

/**
Expand All @@ -7,10 +7,10 @@ import SignUpResponse from "../../models/authentication/signup-response";
export default class UserRegistrationAction {
/**
* ユーザー登録を行うアクションを生成する。
* @param userRegistrar ユーザー登録を行うクラス。
* @param authenticationUserRegistrar ユーザー登録を行うクラス。
*/
constructor(
private readonly userRegistrar: IUserRegistrar
private readonly authenticationUserRegistrar: IAuthenticationUserRegistrar
) {
}

Expand All @@ -21,7 +21,7 @@ export default class UserRegistrationAction {
* @returns サインアップのレスポンス。
*/
public async register(mailAddress: string, password: string): Promise<SignUpResponse> {
const response = await this.userRegistrar.register(mailAddress, password);
const response = await this.authenticationUserRegistrar.register(mailAddress, password);
return response;
}

Expand All @@ -31,7 +31,7 @@ export default class UserRegistrationAction {
* @returns 削除に成功したかどうか。
*/
public async delete(token: string): Promise<boolean> {
const response = await this.userRegistrar.delete(token);
const response = await this.authenticationUserRegistrar.delete(token);
return response;
}
}
6 changes: 3 additions & 3 deletions app/dependency-injector/get-load-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import UserAccountManager from "../libraries/authentication/user-account-manager
import UserAuthenticationAction from "../actions/authentication/user-authentication-action";
import IUserAuthenticator from "../libraries/authentication/i-user-authenticator";
import UserRegistrationAction from "../actions/authentication/user-registration-action";
import IUserRegistrar from "../libraries/authentication/i-user-registrar";
import IAuthenticationUserRegistrar from "../libraries/authentication/i-authentication-user-registrar";
import LatestPostsLoader from "../loaders/post/latest-posts-loader";
import FirebaseClient from "../libraries/authentication/firebase-client";

// ユーザー登録を行うためのクラスを生成する。
const authenticationClient = new FirebaseClient();
const userAccountManager = new UserAccountManager(authenticationClient);
const userRegistrar: IUserRegistrar = userAccountManager;
const userRegistrationAction = new UserRegistrationAction(userRegistrar);
const authenticationUserRegistrar: IAuthenticationUserRegistrar = userAccountManager;
const userRegistrationAction = new UserRegistrationAction(authenticationUserRegistrar);

// ユーザー認証を行うためのクラスを生成する。
const userAuthenticator: IUserAuthenticator = userAccountManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import SignUpResponse from "../../models/authentication/signup-response";

/**
* ユーザー登録を行うためのインターフェース
* 認証するユーザーの登録を行うためのインターフェース
*/
export default interface IUserRegistrar {
export default interface IAuthenticationUserRegistrar {
/**
* ユーザーを登録する。
* @param mailAddress メールアドレス。
Expand Down
4 changes: 2 additions & 2 deletions app/libraries/authentication/user-account-manager.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import SignUpResponse from "../../models/authentication/signup-response";
import IAuthenticationClient from "./i-authentication-client";
import IUserAuthenticator from "./i-user-authenticator";
import IUserRegistrar from "./i-user-registrar";
import IAuthenticationUserRegistrar from "./i-authentication-user-registrar";
import SignInWithEmailPasswordResponse from "../../models/authentication/signin-with-email-password-response";


/**
* ユーザー管理を行うクラス。
*/
export default class UserAccountManager implements IUserRegistrar, IUserAuthenticator {
export default class UserAccountManager implements IAuthenticationUserRegistrar, IUserAuthenticator {
/**
*
* @param authenticationClient ユーザー認証のクライアント。
Expand Down

0 comments on commit 4a1f2c2

Please sign in to comment.