Facebook auth using Ionic5 Angular & capacitor : Is it possible to have different type of user s?
I have the following code that allows me to sign in via Facebook on my Ionic Angular (Capacitor) firebase App :
async signIn(): Promise<void> {
const FACEBOOK_PERMISSIONS = ['public_profile', 'email'];
const result = await Plugins.FacebookLogin.login({ permissions: FACEBOOK_PERMISSIONS });
if (result && result.accessToken) {
let user = { token: result.accessToken.token, userId: result.accessToken.userId }
let navigationExtras: NavigationExtras = {
queryParams: {
userinfo: JSON.stringify(user)
}
};
this.router.navigate(["/feed"], navigationExtras);
}
}
I followed a tutorial so I do not understand everything in this piece of code, I do know the steps it takes and I have a global understanding of it.
I’m looking for two things :
- Retrieve data from my user’s facebook. I do believe it is in "userinfo" but im not sure. And if it is, what is the syntax to get them ?
- How can I have types of users using this kind of auth ? Or do I have to create a separate system using firebase’s realtime database ? I would like to have administrators & basic users. So I can display an administration pannel.
Since I’m new to this technology (2 days lol), I’m pretty clueless on what step I should take now.
I know this is not a code issue but I do not know where to post it. I’m sorry.
Source: Angular Questions