1
Fork 0
mirror of https://github.com/Quackster/Havana.git synced 2025-07-03 05:07:46 +00:00

Merge branch 'develop'

This commit is contained in:
Quackster 2022-09-04 01:09:14 +10:00
commit 9e6c788c40
2 changed files with 0 additions and 23 deletions

View file

@ -487,26 +487,6 @@ public class PlayerDao {
}
}
public static void setAuthToken(int userId, String authTicket, long updatedAt) {
Connection sqlConnection = null;
PreparedStatement preparedStatement = null;
try {
sqlConnection = Storage.getStorage().getConnection();
preparedStatement = Storage.getStorage().prepare("UPDATE users SET authentication_key = ?, authentication_key_date = ? WHERE id = ? LIMIT 1", sqlConnection);
preparedStatement.setString(1, authTicket);
preparedStatement.setLong(2, updatedAt);
preparedStatement.setInt(3, userId);
preparedStatement.execute();
} catch (Exception e) {
Storage.logError(e);
} finally {
Storage.closeSilently(preparedStatement);
Storage.closeSilently(sqlConnection);
}
}
/**
* Reset SSO ticket
* Protects against replay attacks

View file

@ -445,15 +445,12 @@ public class ProfileController {
boolean wordFilterEnabled = !webConnection.post().getString("wordFilterSetting").equals("false");
boolean allowFriendRequests = webConnection.post().getString("allowFriendRequests").equals("true");
boolean allowFriendStalking = webConnection.post().getString("followFriendSetting").equals("true");
boolean shockwavePreferred = webConnection.post().getString("clientpreference").equals("SHOCKWAVE");
String authToken = webConnection.session().getString("authenticationToken");
if (motto.length() > 32) {
motto = motto.substring(0, 32);
}
SessionDao.savePreferences(motto, profileVisibility, onlineStatusVisibility, wordFilterEnabled, allowFriendRequests, allowFriendStalking, userId);
PlayerDao.setAuthToken(userId, authToken, DateUtil.getCurrentTimeSeconds());
webConnection.session().set("settings.saved.successfully", "true");
webConnection.redirect("/profile?tab=2");