isAuthenticated
Often times, it is required to verify that a user account is authenticated into the application or not. This functionality can be achieved through this method. It returns a response with user profile details if user is authorized.
The response codes are as below
AUTH-AUTHORIZED
user is authenticated
AUTH-UNAUTHORIZED
user is not not authenticated
This is how you can use it in your application
// Send request to the to server to check
// if user is authenticated or not
auth.isAuthenticated().then((res) => {
// Handle the response
switch(res.code) {
case "AUTH-AUTHORIZED":
// User is authroized
// log the user profile
console.log(res.userProfile);
}
});