Skip to content

Commit 83aaa85

Browse files
committed
🐛 fix redirection when create account
1 parent 2a0a124 commit 83aaa85

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

src/app/auth/register/register.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class RegisterComponent {
2727
this.errors = [];
2828
if (err.status === 400 && err.error.msg === 'email has already been registered') {
2929
this.showErrors = true;
30-
this.errors.push(`${data.email} ya ha sido registrado, por favor ingrese otro correo`);
30+
this.errors.push(`'${data.email}' no esta disponible, por favor ingrese otro correo`);
3131
}
3232
}
3333
});

src/app/core/components/sidebar/sidebar.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<nav class="sidebar closed">
2-
<div class="logo">
2+
<div class="logo" routerLink="/">
33
<figure>
44
<img src="assets/images/logo.svg" alt="logo_image">
55
</figure>

src/app/core/components/sidebar/sidebar.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ nav {
2929
justify-content: space-between;
3030
gap: 0.8rem;
3131
width: 100%;
32+
cursor: pointer;
3233

3334
& .name {
3435
@include fs-1;

src/app/core/services/auth.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ export class AuthService {
3737

3838
createAccount(data: ICreateAccount): Observable<IUserCreated> {
3939
const url = `${base_url}/user`;
40-
return this.http.post<IUserCreated>(url, data);
40+
return this.http.post<IUserCreated>(url, data).pipe(map((resp) => {
41+
this.userActive = resp.user;
42+
Storage.savelocalStorage('token', resp.token);
43+
return resp;
44+
}));
4145
}
4246

4347
login(data: ILogin): Observable<IUserCreated> {

0 commit comments

Comments
 (0)