From 6166551927c177b3b083620d196b657c9333ea33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Andr=C3=A9?= Date: Tue, 23 Feb 2021 17:37:16 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20pour=20avoir=20une=20redirection?= =?UTF-8?q?=20apr=C3=A8s=20la=20cr=C3=A9ation=20de=20compte.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Back/skydiveLogs-api/Data/JumpsDb-log.db | Bin 3014656 -> 3047424 bytes Back/skydiveLogs-api/toto.txt | 1 - Back/skydiveLogs-api/users.txt | 3 +++ .../src/services/authentication.service.ts | 8 ++++++-- 4 files changed, 9 insertions(+), 3 deletions(-) delete mode 100644 Back/skydiveLogs-api/toto.txt create mode 100644 Back/skydiveLogs-api/users.txt diff --git a/Back/skydiveLogs-api/Data/JumpsDb-log.db b/Back/skydiveLogs-api/Data/JumpsDb-log.db index f06fa07b713b63e73f25dc87646e7b229e539853..df3e7c81cf1b1385d12b8e62b9360c948994c400 100644 GIT binary patch delta 959 zcmd5*T~8B16rGvfing{EsUJwS_))18Y+^v^gT{)jK*2Orp!lF!Sz1@zmb6PveW51j zADD;_Mx%eh#2Q{CzWboYXAJTK_y_gQ1kp4k`sif$aO1VZS>Nu0uIoIx08(Sr!i zp%+o~q5s)h#Ml0n(VC`T-xLIz)(EXd?r^R(o+P|OeC6H8NM}@=ky#Qn!DT3N1iUGi zWQ7E-qK0p-cO&?8O9WzJwl2bKRZMW3Pw;Lg&*Dyk`|L}79pS-LqFRQ{r bdXRBxUZDupQvz@Je}umT16}lNTD|@g23Zv! delta 99 zcmV~$R~Erg6ac{U5WPf;UP5&Cct2)Qj@6lo_@#(%3Q0{}L#C;vt)r`_Z(wL7H#RXf dGgnwxT3OrJ+SxleDxI8FF0O9w9-dy_K7SuZA2a{} diff --git a/Back/skydiveLogs-api/toto.txt b/Back/skydiveLogs-api/toto.txt deleted file mode 100644 index 6f708e6..0000000 --- a/Back/skydiveLogs-api/toto.txt +++ /dev/null @@ -1 +0,0 @@ -1totoTOTO2 \ No newline at end of file diff --git a/Back/skydiveLogs-api/users.txt b/Back/skydiveLogs-api/users.txt new file mode 100644 index 0000000..e5514cf --- /dev/null +++ b/Back/skydiveLogs-api/users.txt @@ -0,0 +1,3 @@ +toto/1totoTOTO2 +tata/1tataTATA2 +titi/1titiTITI2 \ No newline at end of file diff --git a/Front/skydivelogs-app/src/services/authentication.service.ts b/Front/skydivelogs-app/src/services/authentication.service.ts index 1268fa6..68eab99 100644 --- a/Front/skydivelogs-app/src/services/authentication.service.ts +++ b/Front/skydivelogs-app/src/services/authentication.service.ts @@ -55,8 +55,12 @@ export class AuthenticationService extends BaseService { headers: this.headers }) .pipe( - map(result => { - this.login(newUser.login, newUser.password); + map(user => { + // store user details and basic auth credentials in local storage to keep user logged in between page refreshes + user.authdata = window.btoa(newUser.login + ":" + newUser.password); + localStorage.setItem("currentUser", JSON.stringify(user)); + this.currentUserSubject.next(user); + return user; }) ); }