Login marche !

This commit is contained in:
2026-06-10 16:27:04 +02:00
parent 18a8ecb351
commit cc87ceeacd
24 changed files with 60 additions and 47 deletions
+2
View File
@@ -115,6 +115,8 @@
}, },
"serve": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"options": {
"proxyConfig": "proxy.conf.json"},
"configurations": { "configurations": {
"production": { "production": {
"buildTarget": "Knots-Front:build:production" "buildTarget": "Knots-Front:build:production"
+7
View File
@@ -0,0 +1,7 @@
{
"/API": {
"target": "http://localhost:5250",
"secure": false,
"changeOrigin": true
}
}
@@ -8,16 +8,16 @@
<h1>Knots</h1> <h1>Knots</h1>
<div class="card"> <div class="card" [formGroup]="loginForm">
<h3>Connectez-vous à Knots !</h3> <h3>Connectez-vous à Knots !</h3>
<ion-item lines="none" class="input"> <ion-item lines="none" class="input">
<ion-input placeholder="Login..."></ion-input> <ion-input formControlName="name" placeholder="Login..."></ion-input>
</ion-item> </ion-item>
<ion-item lines="none" class="input"> <ion-item lines="none" class="input">
<ion-input type="password" placeholder="Password..."></ion-input> <ion-input formControlName="password" type="password" placeholder="Password..."></ion-input>
</ion-item> </ion-item>
<ion-button expand="block" class="btn" (click)="submitForm()"> <ion-button expand="block" class="btn" (click)="submitForm()">
@@ -31,6 +31,9 @@ export class LoginFormComponent {
}); });
async submitForm(): Promise<void> { async submitForm(): Promise<void> {
console.log('submitForm appelé');
console.log('form valid:', this.loginForm.valid);
console.log('form values:', this.loginForm.value);
if (this.loginForm.valid) { if (this.loginForm.valid) {
this.isLoading = true; this.isLoading = true;
@@ -40,6 +43,7 @@ export class LoginFormComponent {
this.loginForm.value.password! this.loginForm.value.password!
); );
} catch (err: any) { } catch (err: any) {
console.error('Erreur complète:', err);
if (err.status === 401) { if (err.status === 401) {
console.error('Identifiant ou mot de passe incorrect.'); console.error('Identifiant ou mot de passe incorrect.');
} else { } else {
@@ -200,7 +200,7 @@ export class DiscussionsService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Id', 'id',
<any>id, <any>id,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -209,7 +209,7 @@ export class DiscussionsService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Name', 'name',
<any>name, <any>name,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -218,7 +218,7 @@ export class DiscussionsService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'IsGroup', 'isGroup',
<any>isGroup, <any>isGroup,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -227,7 +227,7 @@ export class DiscussionsService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'MembersCount', 'membersCount',
<any>membersCount, <any>membersCount,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
+7 -7
View File
@@ -200,7 +200,7 @@ export class GroupsService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Id', 'id',
<any>id, <any>id,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -209,7 +209,7 @@ export class GroupsService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Nom', 'nom',
<any>nom, <any>nom,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -218,7 +218,7 @@ export class GroupsService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'NombreMembres', 'nombreMembres',
<any>nombreMembres, <any>nombreMembres,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -227,7 +227,7 @@ export class GroupsService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'ProfilePicture', 'profilePicture',
<any>profilePicture, <any>profilePicture,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -275,7 +275,7 @@ export class GroupsService extends BaseService {
} }
/** /**
* @endpoint patch /API/groups/{Id}/membersAmount * @endpoint patch /API/groups/{id}/membersAmount
* @param id * @param id
* @param knotsDTOGroupUpdateGroupMembersAmountDto * @param knotsDTOGroupUpdateGroupMembersAmountDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
@@ -344,7 +344,7 @@ export class GroupsService extends BaseService {
} }
/** /**
* @endpoint patch /API/groups/{Id}/name * @endpoint patch /API/groups/{id}/name
* @param id * @param id
* @param knotsDTOGroupUpdateGroupNameDto * @param knotsDTOGroupUpdateGroupNameDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
@@ -413,7 +413,7 @@ export class GroupsService extends BaseService {
} }
/** /**
* @endpoint patch /API/groups/{Id}/profilePicture * @endpoint patch /API/groups/{id}/profilePicture
* @param id * @param id
* @param knotsDTOGroupUpdateGroupProfilePictureDto * @param knotsDTOGroupUpdateGroupProfilePictureDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
+2 -2
View File
@@ -193,7 +193,7 @@ export class KeysService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Id', 'id',
<any>id2, <any>id2,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -202,7 +202,7 @@ export class KeysService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'EnKey', 'enKey',
<any>enKey, <any>enKey,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
+4 -4
View File
@@ -200,7 +200,7 @@ export class MessagesService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Id', 'id',
<any>id2, <any>id2,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -209,7 +209,7 @@ export class MessagesService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Contenu', 'contenu',
<any>contenu, <any>contenu,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -218,7 +218,7 @@ export class MessagesService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Date', 'date',
<any>date, <any>date,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -227,7 +227,7 @@ export class MessagesService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Type', 'type',
<any>type, <any>type,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
+1 -1
View File
@@ -170,7 +170,7 @@ export class RolesService extends BaseService {
} }
/** /**
* @endpoint get /API/roles/{Libelle} * @endpoint get /API/roles/{libelle}
* @param libelle * @param libelle
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress. * @param reportProgress flag to report request and response progress.
+8 -8
View File
@@ -243,7 +243,7 @@ export class UsersService extends BaseService {
} }
/** /**
* @endpoint get /API/users/{Username} * @endpoint get /API/users/{username}
* @param username * @param username
* @param description * @param description
* @param password * @param password
@@ -266,7 +266,7 @@ export class UsersService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Description', 'description',
<any>description, <any>description,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -275,7 +275,7 @@ export class UsersService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Password', 'password',
<any>password, <any>password,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -284,7 +284,7 @@ export class UsersService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Email', 'email',
<any>email, <any>email,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -293,7 +293,7 @@ export class UsersService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'Tel', 'tel',
<any>tel, <any>tel,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -302,7 +302,7 @@ export class UsersService extends BaseService {
localVarQueryParameters = this.addToHttpParams( localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters, localVarQueryParameters,
'ProfilePicture', 'profilePicture',
<any>profilePicture, <any>profilePicture,
QueryParamStyle.Form, QueryParamStyle.Form,
true, true,
@@ -415,7 +415,7 @@ export class UsersService extends BaseService {
} }
/** /**
* @endpoint patch /API/users/{Id}/contact * @endpoint patch /API/users/{id}/contact
* @param id * @param id
* @param knotsDTOUserUpdateUserContactDto * @param knotsDTOUserUpdateUserContactDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
@@ -553,7 +553,7 @@ export class UsersService extends BaseService {
} }
/** /**
* @endpoint patch /API/users/{Id}/password * @endpoint patch /API/users/{id}/password
* @param id * @param id
* @param knotsDTOUserUpdateUserPasswordDto * @param knotsDTOUserUpdateUserPasswordDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
@@ -10,6 +10,6 @@
export interface KnotsDTODiscussionCreateDiscussionDto { export interface KnotsDTODiscussionCreateDiscussionDto {
id?: number; id: number;
} }
@@ -10,6 +10,6 @@
export interface KnotsDTODiscussionDeleteDiscussionDto { export interface KnotsDTODiscussionDeleteDiscussionDto {
id?: number; id: number;
} }
@@ -10,8 +10,8 @@
export interface KnotsDTOGroupCreateGroupDto { export interface KnotsDTOGroupCreateGroupDto {
nom?: string | null; nom: string;
nombreMembres?: number; nombreMembres: number;
profilePicture?: string | null; profilePicture?: string | null;
} }
@@ -10,6 +10,6 @@
export interface KnotsDTOGroupDeleteGroupDto { export interface KnotsDTOGroupDeleteGroupDto {
id?: number | null; id: number;
} }
@@ -10,6 +10,6 @@
export interface KnotsDTOGroupUpdateGroupMembersAmountDto { export interface KnotsDTOGroupUpdateGroupMembersAmountDto {
membersAmount?: number; membersAmount: number;
} }
@@ -10,6 +10,6 @@
export interface KnotsDTOGroupUpdateGroupNameDto { export interface KnotsDTOGroupUpdateGroupNameDto {
name?: string | null; name: string;
} }
@@ -10,6 +10,6 @@
export interface KnotsDTOKeyCreateKeyDto { export interface KnotsDTOKeyCreateKeyDto {
enKey?: string | null; enKey: string;
} }
@@ -10,6 +10,6 @@
export interface KnotsDTOKeyDeleteKeyDto { export interface KnotsDTOKeyDeleteKeyDto {
id?: number; id: number;
} }
@@ -10,8 +10,8 @@
export interface KnotsDTOMessageCreateMessageDto { export interface KnotsDTOMessageCreateMessageDto {
contenu?: string | null; contenu: string;
date?: string; date: string;
type?: boolean; type: boolean;
} }
@@ -10,6 +10,6 @@
export interface KnotsDTORoleCreateRoleDto { export interface KnotsDTORoleCreateRoleDto {
libelle?: string | null; libelle: string;
} }
@@ -10,6 +10,6 @@
export interface KnotsDTORoleDeleteRoleDto { export interface KnotsDTORoleDeleteRoleDto {
id?: number; id: number;
} }
@@ -10,7 +10,7 @@
export interface KnotsDTOUserUpdateUserContactDto { export interface KnotsDTOUserUpdateUserContactDto {
email?: string | null; email: string;
tel?: string | null; tel: string;
} }
@@ -11,6 +11,6 @@
export interface KnotsDTOUserUpdateUserProfilePictureDto { export interface KnotsDTOUserUpdateUserProfilePictureDto {
id?: number; id?: number;
profilePicture?: string | null; profilePicture: string;
} }
@@ -11,6 +11,6 @@
export interface KnotsDTOUserUpdateUsernameDto { export interface KnotsDTOUserUpdateUsernameDto {
id?: number; id?: number;
username?: string | null; username: string;
} }