Lot of things
Refactored Role enum to be the same as Keycloak roles Managed CORS errors in backend Edited Keycloak config to avoid CORS error Edited frontend API to avoid CORS errors Changed Activite creation management Added debug print in Login (should be removed);
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"realm": "Frisbyee_realm",
|
||||
"resource": "Frisbyee_client",
|
||||
"clientId": "Frisbyee_client",
|
||||
"auth-server-url": "http://localhost:8080",
|
||||
"public-client": true
|
||||
}
|
||||
@@ -6,6 +6,7 @@ const api = axios.create({
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
api.interceptors.request.use((config) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { Session, User, Coach, Activite, Groupe } from "../classes";
|
||||
import { useLocalData } from "../context/useLocalData";
|
||||
import { sessionService } from "../api";
|
||||
import { activiteService, sessionService } from "../api";
|
||||
|
||||
export const CreateSession = () => {
|
||||
const {user} = useLocalData()
|
||||
@@ -24,7 +24,7 @@ export const CreateSession = () => {
|
||||
newActivite.duree= activiteDuree;
|
||||
newActivite.data= new Map<string,string>();
|
||||
try{
|
||||
await sessionService.create(newActivite);
|
||||
await activiteService.create(newActivite);
|
||||
console.log("Session créée");
|
||||
|
||||
setActivities([...activities, newActivite]);
|
||||
|
||||
@@ -16,7 +16,7 @@ export const Login =() =>{
|
||||
|
||||
|
||||
function handleLogin(): void {
|
||||
keycloak.login()
|
||||
keycloak.login();
|
||||
//TODO setUser
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@ export const Login =() =>{
|
||||
<div>
|
||||
User nom : { user.nom}
|
||||
</div>
|
||||
<div>
|
||||
User role : { user.role}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user