Auth: Prevent unauthorized users from accessing the file browser #98

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2022-10-31 12:18:10 +01:00
parent 564ebae162
commit fb4bfe1b2f
5 changed files with 254 additions and 242 deletions

View File

@@ -125,7 +125,10 @@ import {Input, InputInvalid, ClickShort, ClickLong} from "common/input";
export default {
name: 'PPageFiles',
props: {
staticFilter: Object
staticFilter: {
type: Object,
default: () => {},
},
},
data() {
const query = this.$route.query;
@@ -173,12 +176,16 @@ export default {
}
},
created() {
if (this.$config.deny("files", "access_library")) {
this.$router.push({ name: "albums" });
return;
}
this.path = this.$route.params.pathMatch;
this.search();
this.subscriptions.push(Event.subscribe("folders", (ev, data) => this.onUpdate(ev, data)));
this.subscriptions.push(Event.subscribe("touchmove.top", () => this.refresh()));
},
destroyed() {