-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2247 from aura-nw/baseline/main_20230822
Baseline/main 20230822
- Loading branch information
Showing
149 changed files
with
2,710 additions
and
932 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export enum ProfileTab { | ||
Setting = 'setting', | ||
PrivateNameTag = 'private', | ||
WatchList = 'watchList', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http'; | ||
import { Observable } from 'rxjs'; | ||
import { AuthenticationService } from '../services/auth.service'; | ||
|
||
@Injectable() | ||
export class JwtInterceptor implements HttpInterceptor { | ||
constructor(private authenticationService: AuthenticationService) {} | ||
constructor() {} | ||
|
||
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { | ||
const currentUser = this.authenticationService.currentUserValue; | ||
request = request.clone({ | ||
setHeaders: { | ||
}, | ||
}); | ||
const accessToken = localStorage.getItem('accessToken'); | ||
if (accessToken) { | ||
request = request.clone({ | ||
setHeaders: { | ||
Authorization: 'Bearer ' + accessToken.replace(/"/g, ''), | ||
}, | ||
}); | ||
} | ||
return next.handle(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs'; | ||
import { EnvironmentService } from '../data-services/environment.service'; | ||
import { CommonService } from './common.service'; | ||
|
||
@Injectable() | ||
export class UserService extends CommonService { | ||
chainInfo = this.environmentService.configValue.chain_info; | ||
|
||
constructor(private http: HttpClient, private environmentService: EnvironmentService) { | ||
super(http, environmentService); | ||
} | ||
|
||
registerUser(payload): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/users/register-with-password`, payload); | ||
} | ||
|
||
loginWithPassword(payload): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/auth/login-with-password`, payload); | ||
} | ||
|
||
changePassword(payload): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/users/change-password`, payload); | ||
} | ||
|
||
resendVerifyEmail(email: string): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/auth/resend-verification-email/${email}`); | ||
} | ||
|
||
sendResetPasswordEmail(email: string): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/auth/send-reset-password-email/${email}`); | ||
} | ||
|
||
resetPasswordWithCode(payload): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/auth/reset-password`, payload); | ||
} | ||
|
||
loginWithGoogle(payload): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/auth/google`, payload); | ||
} | ||
|
||
refreshToken(payload): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/auth/refresh-token`, payload); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.