File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ export class LoginComponent implements OnInit {
3838 username : this . form . get ( 'username' ) . value , // Username input field
3939 password : this . form . get ( 'password' ) . value // Password input field
4040 } ;
41- console . log ( user ) ;
4241 this . authService . loginUser ( user ) . subscribe ( data => {
4342 this . authService . storeUserData ( data . token , data . user , data . isAdmin ) ;
4443 // After 2 seconds, redirect to dashboard page
Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ <h2 class="page-header">{{user.name}}</h2>
33 < ul class ="list-group ">
44 < li class ="list-group-item "> Username: {{user.username}}</ li >
55 < li class ="list-group-item "> Email: {{user.email_id}}</ li >
6- < li class ="list-group-item "> Name: {{user.name}}</ li >
6+ < li class ="list-group-item "> Name: {{ user.name }}</ li >
7+ < li class ="list-group-item "> College: {{ user.college }}</ li >
8+ < li class ="list-group-item "> Date Of Birth: {{ user.dob }}</ li >
9+ < li class ="list-group-item "> City: {{ user.city }}</ li >
10+ < li class ="list-group-item "> Gender: {{ user.gender }}</ li >
711 </ ul >
8- </ div >
12+ </ div >
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ import { Router } from '@angular/router';
99} )
1010export class ProfileComponent implements OnInit {
1111
12- user : Object ;
12+ user ;
1313 constructor (
1414 private authService : AuthService ,
1515 private router : Router
1616 ) {
1717 this . user = authService . getprofile ( ) . subscribe ( profile => {
18- this . user = profile . username ;
18+ this . user = profile . msg ;
1919 } ) ;
2020 console . log ( this . user ) ;
2121 }
Original file line number Diff line number Diff line change @@ -29,12 +29,8 @@ export class AuthService {
2929 }
3030
3131 loadToken ( ) {
32- < < < << << HEAD
3332 this . authToken = localStorage . getItem ( 'token' ) ;
3433 console . log ( this . authToken ) ; // Get token and asssign to variable to be used elsewhere
35- === === =
36- this. authToken = localStorage . getItem ( 'token' ) ; // Get token and asssign to variable to be used elsewhere
37- >>> >>> > 284547 cb710a93fde32823f40edc4d4f83454bdd
3834 }
3935 registerUser ( user ) {
4036 return this . http . post ( this . domain + '/users/signup' , user )
@@ -73,6 +69,7 @@ export class AuthService {
7369 localStorage . clear ( ) ; // Clear local storage
7470 }
7571 getprofile ( ) {
76- return this . http . get ( this . domain + '/users/profile' ) . map ( res => res . json ( ) ) ;
72+ this . createAuthenticationHeaders ( ) ;
73+ return this . http . get ( this . domain + '/users/profile' , this . options ) . map ( res => res . json ( ) ) ;
7774 }
7875}
You can’t perform that action at this time.
0 commit comments