amplify-user-profile's People
Forkers
gsans khocef activeprofiles gmkbabu slimaneguemil shahriar701 mmoscalu chrisplyn richamehta99 chris7716 pantazos msilynx awsbt doctushartwald phenomenan roshangit007amplify-user-profile's Issues
Username is not getting printed after logging in.
Once the user is successfully logged in to the profile, username is not getting printed. Once the profile page is mannually refreshed, it gets printed on the page. I tried to log the username on console, it works fine and the username gets printed once the profile page is loaded at the sign in. I even tried printing a static variable in profile page. It also does not get printed while the profile page is being loaded after signing in. But it also gets printed on the page, once the profile page is mannually reloaded / refreshed.
auth.component.ts
import { Component, OnInit } from '@angular/core';
import { Hub, Auth } from 'aws-amplify';
import { Router } from '@angular/router';
@Component({
selector: 'app-auth',
templateUrl: './auth.component.html',
styleUrls: ['./auth.component.scss']
})
export class AuthComponent implements OnInit {
constructor(public router: Router) {
}
ngOnInit(): void {
Hub.listen('auth', (data) => {
console.log(data);
switch (data.payload.event) {
case 'signIn':
this.router.navigate(['/profile']);
break;
case 'signOut':
this.router.navigate(['/login']);
break;
}
});
}
}
profile.component.ts
import { Component, OnInit } from '@angular/core';
import { Auth, Hub } from 'aws-amplify';
import { Router } from '@angular/router';
@Component({
selector: 'app-profile',
templateUrl: './profile.component.html',
styleUrls: ['./profile.component.scss']
})
export class ProfileComponent implements OnInit {
userId: string;
userName: string;
var1 : String = "temp";
constructor(public router: Router) { }
ngOnInit(): void {
Auth.currentAuthenticatedUser({
bypassCache: false
}).then(async user => {
this.userId = user.attributes.sub;
this.userName = user.username;
console.log(this.userName);
})
.catch(err => console.log("err assigning"));
}
logOut() {
console.log("Log out");
this.router.navigate(['/login']);
}
}
profile.component.html
Hello {{userName}}
Cannot get image after uploaded
I got a 403 forbidden error when GET profile image after upload and also OnInit().
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.