diff --git a/src/main/java/com/example/cosmos_serversb/models/Users.java b/src/main/java/com/example/cosmos_serversb/models/Users.java index c74bc2f..4d564bc 100644 --- a/src/main/java/com/example/cosmos_serversb/models/Users.java +++ b/src/main/java/com/example/cosmos_serversb/models/Users.java @@ -55,6 +55,7 @@ createToken(uId); Password password = new Password(pw, uId);//パスワードとユーザー情報を紐づけ User testUser = new User(name, uId, uri, iconImage);//名前、uId、ユーザーuri、アイコンイメージを保存 + session.save(password); session.save(testUser); return testUser; } @@ -146,6 +147,13 @@ public static boolean checkPassword(String uId, String pw) { //与えられたパスワードとUserのパスワードを比較し結果を返す - return true; + Session session = SessionManager.getInstance().getSession(); + Password findPassword = (Password) session.load(Password.class, uId); + if (findPassword.getPw().equals(pw)) { + return true; + } else { + return false; + } + } } \ No newline at end of file