Compare commits
6 Commits
19fef63b0e
...
main
Author | SHA1 | Date | |
---|---|---|---|
a35a423447 | |||
|
47be7d340b | ||
|
232d10b164 | ||
bc7ce888ad | |||
ed67a3734a | |||
95eb154556 |
@@ -1,8 +1,6 @@
|
|||||||
package enseirb.myinpulse.controller;
|
package enseirb.myinpulse.controller;
|
||||||
|
|
||||||
import enseirb.myinpulse.model.Administrator;
|
|
||||||
import enseirb.myinpulse.model.Entrepreneur;
|
import enseirb.myinpulse.model.Entrepreneur;
|
||||||
import enseirb.myinpulse.service.AdminApiService;
|
|
||||||
import enseirb.myinpulse.service.EntrepreneurApiService;
|
import enseirb.myinpulse.service.EntrepreneurApiService;
|
||||||
import enseirb.myinpulse.service.UtilsService;
|
import enseirb.myinpulse.service.UtilsService;
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { jwtDecode } from "jwt-decode"; // i hope this doesn't break the code later
|
import { jwtDecode } from "jwt-decode"; // i hope this doesn't break the code later
|
||||||
import { store } from "../main.ts";
|
import { store } from "../main.ts";
|
||||||
@@ -13,7 +13,7 @@ type TokenPayload = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const customRequest = ref("");
|
//const customRequest = ref("");
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (store.authenticated && store.user.token) {
|
if (store.authenticated && store.user.token) {
|
||||||
@@ -25,7 +25,7 @@ onMounted(() => {
|
|||||||
router.push("/admin");
|
router.push("/admin");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (roles.includes("MyINPulse-entrepreneur")) {
|
if (roles.includes("MyINPulse-entrepreneur")) {
|
||||||
router.push("/canvas");
|
router.push("/canvas");
|
||||||
return;
|
return;
|
||||||
@@ -34,7 +34,10 @@ onMounted(() => {
|
|||||||
checkPending(
|
checkPending(
|
||||||
(response) => {
|
(response) => {
|
||||||
const isValidated = response.data === true;
|
const isValidated = response.data === true;
|
||||||
if (isValidated && roles.includes("MyINPulse-entrepreneur")) {
|
if (
|
||||||
|
isValidated &&
|
||||||
|
roles.includes("MyINPulse-entrepreneur")
|
||||||
|
) {
|
||||||
router.push("/canvas");
|
router.push("/canvas");
|
||||||
//router.push("/JorCproject");
|
//router.push("/JorCproject");
|
||||||
} else {
|
} else {
|
||||||
@@ -65,7 +68,7 @@ onMounted(() => {
|
|||||||
<error-wrapper></error-wrapper>
|
<error-wrapper></error-wrapper>
|
||||||
<div class="auth-container">
|
<div class="auth-container">
|
||||||
<div class="auth-card">
|
<div class="auth-card">
|
||||||
<h1>Bienvenue</h1>
|
<h1>Bienvenue à MyINPulse</h1>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="status"
|
class="status"
|
||||||
@@ -83,11 +86,12 @@ onMounted(() => {
|
|||||||
<div class="actions">
|
<div class="actions">
|
||||||
<button @click="store.login">Login</button>
|
<button @click="store.login">Login</button>
|
||||||
<button @click="store.logout">Logout</button>
|
<button @click="store.logout">Logout</button>
|
||||||
<button @click="store.signup">Signup-admin</button>
|
<!--<button @click="store.signup">Signup-admin</button>
|
||||||
<button @click="store.signup">Signup-Entrepreneur</button>
|
<button @click="store.signup">Signup-Entrepreneur</button>
|
||||||
<button @click="store.refreshUserToken">Refresh Token</button>
|
<button @click="store.refreshUserToken">Refresh Token</button>-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
<div v-if="store.authenticated" class="token-section">
|
<div v-if="store.authenticated" class="token-section">
|
||||||
<p><strong>Access Token:</strong></p>
|
<p><strong>Access Token:</strong></p>
|
||||||
<pre>{{ store.user.token }}</pre>
|
<pre>{{ store.user.token }}</pre>
|
||||||
@@ -111,7 +115,7 @@ onMounted(() => {
|
|||||||
/>
|
/>
|
||||||
<button @click="callApi(customRequest)">Call</button>
|
<button @click="callApi(customRequest)">Call</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -5,21 +5,17 @@
|
|||||||
<button class="return-button" @click="store.logout">Logout</button>
|
<button class="return-button" @click="store.logout">Logout</button>
|
||||||
<div class="spinner"></div>
|
<div class="spinner"></div>
|
||||||
<p>Finalisation du compte en cours...</p>
|
<p>Finalisation du compte en cours...</p>
|
||||||
|
|
||||||
<button v-if="hasError" @click="retry" class="retry-button">
|
|
||||||
Réessayer
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted } from "vue";
|
import { onMounted } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
//import { useRouter } from "vue-router";
|
||||||
import { finalizeAccount } from "@/services/Apis/Unauth";
|
import { finalizeAccount } from "@/services/Apis/Unauth";
|
||||||
import Header from "@/components/HeaderComponent.vue";
|
import Header from "@/components/HeaderComponent.vue";
|
||||||
import { store } from "@/main.ts";
|
import { store } from "@/main.ts";
|
||||||
const router = useRouter();
|
//const router = useRouter();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
finalizeAccount(
|
finalizeAccount(
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<img
|
<img
|
||||||
src="@/components/icons/logo inpulse.png"
|
src="@/components/icons/logo inpulse.png"
|
||||||
@@ -40,10 +40,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">import { ref, onMounted } from "vue";
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import Project from "@/ApiClasses/Project";
|
import Project from "@/ApiClasses/Project";
|
||||||
import Header from "../components/HeaderComponent.vue";
|
import Header from "../components/HeaderComponent.vue";
|
||||||
|
import { store } from "@/main.ts";
|
||||||
import {
|
import {
|
||||||
requestProjectCreation,
|
requestProjectCreation,
|
||||||
checkIfProjectIsActive,
|
checkIfProjectIsActive,
|
||||||
@@ -51,8 +53,6 @@ import {
|
|||||||
} from "@/services/Apis/Entrepreneurs";
|
} from "@/services/Apis/Entrepreneurs";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
import { requestProjectCreation } from "@/services/Apis/Entrepreneurs.ts";
|
|
||||||
import { store } from "@/main.ts";
|
|
||||||
const choix = ref<string | null>(null);
|
const choix = ref<string | null>(null);
|
||||||
const nomProjet = ref("");
|
const nomProjet = ref("");
|
||||||
|
|
||||||
@@ -112,7 +112,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
Reference in New Issue
Block a user