Class Authenticator
java.lang.Object
com.example.skeddly.business.user.Authenticator
Handles the authentication of a user
-
Constructor Summary
ConstructorsConstructorDescriptionAuthenticator(android.content.Context context, DatabaseHandler databaseHandler) Constructor for the AuthenticatorAuthenticator(android.content.Context context, DatabaseHandler databaseHandler, boolean inTesting) Constructor for the Authenticator -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListenerForUserLoaded(UserLoaded callback) Sets the callback for when the user is loadedvoidCommits the user changes to the databasevoidDeletes the user from the databasegetUser()Gets the initialized userbooleanGets if the user needs to sign up
-
Constructor Details
-
Authenticator
Constructor for the Authenticator- Parameters:
context- The app contextdatabaseHandler- The database handler
-
Authenticator
public Authenticator(android.content.Context context, DatabaseHandler databaseHandler, boolean inTesting) Constructor for the Authenticator- Parameters:
context- The app contextdatabaseHandler- The database handlerinTesting- True if the app is in testing mode. False otherwise.
-
-
Method Details
-
addListenerForUserLoaded
Sets the callback for when the user is loaded- Parameters:
callback- The callback to set
-
deleteUser
public void deleteUser()Deletes the user from the database- See Also:
-
getUser
Gets the initialized user- Returns:
- User
-
isShowSignUp
public boolean isShowSignUp()Gets if the user needs to sign up- Returns:
- True if the signup page needs to be shown. False otherwise.
- See Also:
-
commitUserChanges
public void commitUserChanges()Commits the user changes to the database- See Also:
-