diff --git a/Back/skydiveLogs-api/Data/JumpsDb-log.db b/Back/skydiveLogs-api/Data/JumpsDb-log.db index f06fa07..df3e7c8 100644 Binary files a/Back/skydiveLogs-api/Data/JumpsDb-log.db and b/Back/skydiveLogs-api/Data/JumpsDb-log.db differ 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; }) ); }