Skip to content

Commit f3aa4e7

Browse files
committed
Frontend: Prevent replacing new auth data with restored values
Signed-off-by: Michael Mayer <michael@photoprism.app>
1 parent 33577a1 commit f3aa4e7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

frontend/src/common/session.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ export default class Session {
5656
}
5757

5858
// Restore authentication data stored under previously used keys.
59-
if (this.storage.getItem("authToken") && this.storage.getItem("sessionId")) {
59+
if (
60+
!this.storage.getItem(this.storageKey + ".token") &&
61+
this.storage.getItem("authToken") &&
62+
!this.storage.getItem(this.storageKey + ".id") &&
63+
this.storage.getItem("sessionId")
64+
) {
6065
this.storage.setItem(this.storageKey + ".token", this.storage.getItem("authToken"));
6166
this.storage.removeItem("authToken");
6267

0 commit comments

Comments
 (0)