Niftron Authentication
Auth Redirect
The following steps are required to set up Niftron Auth.
Add Script to index.html only if you are using Niftron Auth Redirect.
...........<head>...........<script src="https://niftron-util.s3.amazonaws.com/niftron-auth.js"></script>...........</head>...........
Niftron Auth Redirect allows niftron creators to integrate niftron auth to their applications.
niftron.user.authRedirect();
Check Auth State
This returns the user object upon change in auth state.
niftron.user.onAuthStateChanged(authUser => {console.log(authUser)},err => {if (err) {console.log(err)}});
Get Current User
This returns the user object of the current user.
niftron.user.getCurrentUser(authUser => {console.log(authUser)},err => {if (err) {console.log(err)}});