Fixes Backend OAuth2 Endpoint

This commit is contained in:
2022-11-11 02:30:30 -03:00
parent fbc485698d
commit dd38ed60e7
9 changed files with 34 additions and 14 deletions

View File

@@ -49,7 +49,6 @@
background-color: #ffffff;
}
.separator-line {
justify-content: center;
align-content: center;

View File

@@ -18,6 +18,8 @@ export class AuthService {
readonly BACKEND_PATH = environment.backendPath;
readonly BACKEND_OAUTH_PATH = environment.backendOAuthPath;
constructor(private http: HttpClient) { }
login(userAuthAtempt: User): void {
@@ -25,11 +27,11 @@ export class AuthService {
}
googleLogin() {
window.open(this.BACKEND_PATH + '/oauth2/authorization/google', '_self');
window.open(this.BACKEND_OAUTH_PATH + '/oauth2/authorization/google', '_self');
}
githubLogin() {
window.open(this.BACKEND_PATH + '/oauth2/authorization/github', '_self');
window.open(this.BACKEND_OAUTH_PATH + '/oauth2/authorization/github', '_self');
}
loginGoogleUser(p: any): void {
@@ -92,7 +94,7 @@ export class AuthService {
);
return this.http.get<User>(
this.BACKEND_PATH + '/login/oauth2/code/google',
this.BACKEND_OAUTH_PATH + '/login/oauth2/code/google',
{
withCredentials: true,
params: params
@@ -111,7 +113,7 @@ export class AuthService {
);
return this.http.get<User>(
this.BACKEND_PATH + '/login/oauth2/code/github',
this.BACKEND_OAUTH_PATH + '/login/oauth2/code/github',
{
withCredentials: true,
params: params

View File

@@ -1,4 +1,5 @@
export const environment = {
production: true,
backendPath: '/api'
backendPath: '/api',
backendOAuthPath: 'https://api.hideyoshi.com.br'
};

View File

@@ -4,7 +4,8 @@
export const environment = {
production: false,
backendPath: 'http://localhost:8070'
backendPath: '/api',
backendOAuthPath: 'http://localhost:8070'
};
/*

7
src/proxy.conf.json Normal file
View File

@@ -0,0 +1,7 @@
{
"/api": {
"target": "http://localhost:8070",
"secure": false,
"pathRewrite": {"^/api" : ""}
}
}