Auth: Accept access token as passwd with fail rate limit #782 #808 #3943

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-01-14 18:28:17 +01:00
parent 9586a9ec69
commit fed1d8ad95
71 changed files with 930 additions and 507 deletions

View File

@@ -403,13 +403,13 @@ export default class Session {
// Use a static auth token in public mode, as no additional authentication is required.
this.setAuthToken(PublicAuthToken);
this.setId(PublicSessionID);
return Api.get("session/" + this.getId()).then((resp) => {
return Api.get("session").then((resp) => {
this.setResp(resp);
return Promise.resolve();
});
} else if (this.isAuthenticated()) {
// Check the auth token by fetching the client session data from the API.
return Api.get("session/" + this.getId())
return Api.get("session")
.then((resp) => {
this.setResp(resp);
return Promise.resolve();
@@ -452,7 +452,7 @@ export default class Session {
logout(noRedirect) {
if (this.isAuthenticated()) {
return Api.delete("session/" + this.getId())
return Api.delete("session")
.then(() => {
return this.onLogout(noRedirect);
})