1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 23:59:45 +02:00

feat(backend): start multi-tenant support (WIP) (#680)

* fix ts types

* feat(code-generation): ♻️ update code-generation formats

* new scope

* add step button

* fix linter error

* update code-generation tags

* feat(backend):  start multi-tenant support

* feat(backend):  group invitation token generation and signup

* refactor(backend): ♻️ move group admin actions to admin router

* set url base to include `/admin`

* feat(frontend):  generate user sign-up links

* test(backend):  refactor test-suite to further decouple tests (WIP)

* feat(backend): 🐛 assign owner on backup import for recipes

* fix(backend): 🐛 assign recipe owner on migration from other service

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden 2021-09-09 08:51:29 -08:00 committed by GitHub
parent 3c504e7048
commit bdaf758712
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 1793 additions and 949 deletions

View file

@ -174,50 +174,44 @@
type="password"
/>
<v-btn :loading="loggingIn" color="primary" type="submit" large rounded class="rounded-xl" block>
Login
{{ $t("user.login") }}
</v-btn>
</v-form>
</v-card-text>
<v-btn v-if="$config.ALLOW_SIGNUP" class="mx-auto" text to="/register"> Register </v-btn>
<v-btn v-else class="mx-auto" text disabled> Invite Only </v-btn>
<v-btn v-if="allowSignup" class="mx-auto" text to="/register"> {{ $t("user.register") }} </v-btn>
<v-btn v-else class="mx-auto" text disabled> {{ $t("user.invite-only") }} </v-btn>
</v-card>
</v-container>
</template>
<script lang="ts">
import { defineComponent } from "@nuxtjs/composition-api";
<script lang="ts" setup>
import { defineComponent, ref, useContext } from "@nuxtjs/composition-api";
import { computed, reactive } from "@vue/reactivity";
const { $auth } = useContext();
const form = reactive({
email: "changeme@email.com",
password: "MyPassword",
});
const loggingIn = ref(false);
const allowSignup = computed(() => process.env.ALLOW_SIGNUP);
async function authenticate() {
loggingIn.value = true;
const formData = new FormData();
formData.append("username", form.email);
formData.append("password", form.password);
await $auth.loginWith("local", { data: formData });
loggingIn.value = false;
}
</script>
<script lang="ts">
export default defineComponent({
layout: "basic",
setup() {
return {};
},
data() {
return {
loggingIn: false,
form: {
email: "changeme@email.com",
password: "MyPassword",
},
};
},
computed: {
allowSignup(): boolean {
// @ts-ignore
return process.env.ALLOW_SIGNUP;
},
},
methods: {
async authenticate() {
this.loggingIn = true;
const formData = new FormData();
formData.append("username", this.form.email);
formData.append("password", this.form.password);
await this.$auth.loginWith("local", { data: formData });
this.loggingIn = false;
},
},
});
</script>
</script>