Compare commits
8 Commits
3ef2d8a198
...
main
Author | SHA1 | Date | |
---|---|---|---|
a35a423447 | |||
|
47be7d340b | ||
|
232d10b164 | ||
bc7ce888ad | |||
ed67a3734a | |||
95eb154556 | |||
19fef63b0e | |||
1fd95265ea |
@@ -1,8 +1,6 @@
|
||||
package enseirb.myinpulse.controller;
|
||||
|
||||
import enseirb.myinpulse.model.Administrator;
|
||||
import enseirb.myinpulse.model.Entrepreneur;
|
||||
import enseirb.myinpulse.service.AdminApiService;
|
||||
import enseirb.myinpulse.service.EntrepreneurApiService;
|
||||
import enseirb.myinpulse.service.UtilsService;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import { onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { jwtDecode } from "jwt-decode"; // i hope this doesn't break the code later
|
||||
import { store } from "../main.ts";
|
||||
@@ -13,7 +13,7 @@ type TokenPayload = {
|
||||
};
|
||||
};
|
||||
|
||||
const customRequest = ref("");
|
||||
//const customRequest = ref("");
|
||||
|
||||
onMounted(() => {
|
||||
if (store.authenticated && store.user.token) {
|
||||
@@ -25,16 +25,19 @@ onMounted(() => {
|
||||
router.push("/admin");
|
||||
return;
|
||||
}
|
||||
/*
|
||||
|
||||
if (roles.includes("MyINPulse-entrepreneur")) {
|
||||
router.push("/canvas");
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
checkPending(
|
||||
(response) => {
|
||||
const isValidated = response.data === true;
|
||||
if (isValidated && roles.includes("MyINPulse-entrepreneur")) {
|
||||
if (
|
||||
isValidated &&
|
||||
roles.includes("MyINPulse-entrepreneur")
|
||||
) {
|
||||
router.push("/canvas");
|
||||
//router.push("/JorCproject");
|
||||
} else {
|
||||
@@ -43,7 +46,7 @@ onMounted(() => {
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
if (error.response?.status === 404) {
|
||||
if (error.response?.status === 403) {
|
||||
router.push("/finalize");
|
||||
} else {
|
||||
console.error(
|
||||
@@ -65,7 +68,7 @@ onMounted(() => {
|
||||
<error-wrapper></error-wrapper>
|
||||
<div class="auth-container">
|
||||
<div class="auth-card">
|
||||
<h1>Bienvenue</h1>
|
||||
<h1>Bienvenue à MyINPulse</h1>
|
||||
|
||||
<div
|
||||
class="status"
|
||||
@@ -83,11 +86,12 @@ onMounted(() => {
|
||||
<div class="actions">
|
||||
<button @click="store.login">Login</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.refreshUserToken">Refresh Token</button>
|
||||
<button @click="store.refreshUserToken">Refresh Token</button>-->
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div v-if="store.authenticated" class="token-section">
|
||||
<p><strong>Access Token:</strong></p>
|
||||
<pre>{{ store.user.token }}</pre>
|
||||
@@ -111,7 +115,7 @@ onMounted(() => {
|
||||
/>
|
||||
<button @click="callApi(customRequest)">Call</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@@ -110,7 +110,7 @@ const props = defineProps<{
|
||||
isAdmin: boolean;
|
||||
}>();
|
||||
|
||||
const IS_MOCK_MODE = false;
|
||||
const IS_MOCK_MODE = true;
|
||||
const IS_ADMIN = props.isAdmin;
|
||||
|
||||
const expanded = ref(false);
|
||||
|
@@ -2,6 +2,7 @@
|
||||
<Header />
|
||||
<div class="finalize-page">
|
||||
<div class="loader-container">
|
||||
<button class="return-button" @click="store.logout">Logout</button>
|
||||
<div class="spinner"></div>
|
||||
<p>Finalisation du compte en cours...</p>
|
||||
</div>
|
||||
@@ -10,15 +11,16 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
//import { useRouter } from "vue-router";
|
||||
import { finalizeAccount } from "@/services/Apis/Unauth";
|
||||
import Header from "@/components/HeaderComponent.vue";
|
||||
const router = useRouter();
|
||||
import { store } from "@/main.ts";
|
||||
//const router = useRouter();
|
||||
|
||||
onMounted(() => {
|
||||
finalizeAccount(
|
||||
() => {
|
||||
router.push("/JorCproject");
|
||||
console.log("finalize sended");
|
||||
},
|
||||
(error) => {
|
||||
console.error("Erreur lors de la finalisation :", error);
|
||||
@@ -55,6 +57,19 @@ onMounted(() => {
|
||||
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 {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
|
@@ -6,6 +6,7 @@
|
||||
alt="INPulse Logo"
|
||||
class="logo"
|
||||
/>
|
||||
<button class="return-button" @click="store.logout">Logout</button>
|
||||
</header>
|
||||
|
||||
<div class="choix-projet">
|
||||
@@ -39,10 +40,12 @@
|
||||
</div>
|
||||
</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 Project from "@/ApiClasses/Project";
|
||||
import Header from "../components/HeaderComponent.vue";
|
||||
import { store } from "@/main.ts";
|
||||
import {
|
||||
requestProjectCreation,
|
||||
checkIfProjectIsActive,
|
||||
@@ -109,7 +112,6 @@ onMounted(() => {
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -167,4 +169,17 @@ input {
|
||||
.logo {
|
||||
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>
|
||||
|
Reference in New Issue
Block a user