Skip to content

Commit e0895a1

Browse files
committed
heroku bug auth fix
1 parent dddeefc commit e0895a1

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

angular-src/src/app/services/auth.service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { HttpClientModule, HttpClient, HttpHeaders } from '@angular/common/http'
44
import 'rxjs/add/operator/map';
55
import {User} from "../models/User";
66
import {tokenNotExpired} from 'angular2-jwt';
7+
import {Values} from "../models/Values";
78

89
@Injectable()
910

@@ -12,14 +13,15 @@ export class AuthService {
1213
authToken: any;
1314
user: User;
1415

15-
constructor(private http:HttpClient) {}
16+
constructor(private http:HttpClient,
17+
private values: Values) {}
1618

1719
authenticateUser(user){
1820
let headers = new HttpHeaders();
1921
//this.loadToken();
2022
//headers = headers.append('authorization', this.authToken);
2123
headers = headers.append('Content-Type', 'application/json');
22-
return this.http.post<AuthenticateResultData>('http://localhost:3000/users/authenticate', user, {headers: headers})
24+
return this.http.post<AuthenticateResultData>(this.values.getServiceEndPoint()+'users/authenticate', user, {headers: headers})
2325
.map(
2426
res => res);
2527
}
@@ -49,7 +51,7 @@ export class AuthService {
4951
this.loadToken();
5052
headers = headers.append('Authorization', this.authToken);
5153
headers = headers.append('Content-Type', 'application/json');
52-
return this.http.get<any>('http://localhost:3000/users/profile', {headers: headers})
54+
return this.http.get<any>(this.values.getServiceEndPoint()+'users/profile', {headers: headers})
5355
.map(res => res);
5456
}
5557

public/inline.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/main.bundle.js

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/main.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)