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