Skip to content

Commit 8029ef3

Browse files
author
Daan Hoogland
committed
phase out AccountDoa.findUserAccountByApiKey(apiKey)
1 parent 305a0a8 commit 8029ef3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

server/src/main/java/com/cloud/user/AccountManagerImpl.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3049,7 +3049,14 @@ protected void updateLoginAttemptsWhenIncorrectLoginAttemptsEnabled(UserAccount
30493049

30503050
@Override
30513051
public Pair<User, Account> findUserByApiKey(String apiKey) {
3052-
return _accountDao.findUserAccountByApiKey(apiKey);
3052+
UserAccount userAccount = _userAccountDao.getUserByApiKey(apiKey);
3053+
if (userAccount != null) {
3054+
User user = _userDao.getUser(userAccount.getId());
3055+
Account account = _accountDao.findById(userAccount.getAccountId());
3056+
return new Pair<>(user, account);
3057+
} else {
3058+
return null;
3059+
}
30533060
}
30543061

30553062
@Override

0 commit comments

Comments
 (0)