Compare commits
7 Commits
3ef2d8a198
...
front_foun
Author | SHA1 | Date | |
---|---|---|---|
|
47be7d340b | ||
|
232d10b164 | ||
bc7ce888ad | |||
ed67a3734a | |||
95eb154556 | |||
19fef63b0e | |||
1fd95265ea |
@@ -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,16 +25,19 @@ 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;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
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 {
|
||||||
@@ -43,7 +46,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
if (error.response?.status === 404) {
|
if (error.response?.status === 403) {
|
||||||
router.push("/finalize");
|
router.push("/finalize");
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
console.error(
|
||||||
@@ -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>
|
||||||
|
@@ -110,7 +110,7 @@ const props = defineProps<{
|
|||||||
isAdmin: boolean;
|
isAdmin: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const IS_MOCK_MODE = false;
|
const IS_MOCK_MODE = true;
|
||||||
const IS_ADMIN = props.isAdmin;
|
const IS_ADMIN = props.isAdmin;
|
||||||
|
|
||||||
const expanded = ref(false);
|
const expanded = ref(false);
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
<Header />
|
<Header />
|
||||||
<div class="finalize-page">
|
<div class="finalize-page">
|
||||||
<div class="loader-container">
|
<div class="loader-container">
|
||||||
|
<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>
|
||||||
</div>
|
</div>
|
||||||
@@ -10,15 +11,16 @@
|
|||||||
|
|
||||||
<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";
|
||||||
const router = useRouter();
|
import { store } from "@/main.ts";
|
||||||
|
//const router = useRouter();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
finalizeAccount(
|
finalizeAccount(
|
||||||
() => {
|
() => {
|
||||||
router.push("/JorCproject");
|
console.log("finalize sended");
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.error("Erreur lors de la finalisation :", error);
|
console.error("Erreur lors de la finalisation :", error);
|
||||||
@@ -55,6 +57,19 @@ onMounted(() => {
|
|||||||
animation: spin 0.8s linear infinite;
|
animation: spin 0.8s linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.return-button {
|
||||||
|
background-color: #009cde;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 10px 15px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 14px;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes spin {
|
@keyframes spin {
|
||||||
0% {
|
0% {
|
||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
|
@@ -1,11 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<img
|
<img
|
||||||
src="@/components/icons/logo inpulse.png"
|
src="@/components/icons/logo inpulse.png"
|
||||||
alt="INPulse Logo"
|
alt="INPulse Logo"
|
||||||
class="logo"
|
class="logo"
|
||||||
/>
|
/>
|
||||||
|
<button class="return-button" @click="store.logout">Logout</button>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="choix-projet">
|
<div class="choix-projet">
|
||||||
@@ -39,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,
|
||||||
@@ -109,7 +112,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -167,4 +169,17 @@ input {
|
|||||||
.logo {
|
.logo {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.return-button {
|
||||||
|
background-color: #009cde;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 10px 15px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 14px;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Reference in New Issue
Block a user