The login and logout feature has the following requirements:
The login interface should be accessible from any view in the application.
Login is accomplished using the user name and password supplied at the time of registration.
If login is successful the login form must be cleared.
A welcome message containing the user's first name should be displayed to replace the login form.
All the current user's account information should become available to the application. The login service will return this data if an account is found.
If login is not successful, the user should be notified and told to check the user name and password and try again.
Logout consists of clearing the data for the current user and returning to the main posts view.
To make the login form accessible from anywhere in the application, you will add it to the ApplicationControlBar. The login form will be a simple form that collects the user name and password and has a submit button.
To clear the form you will use the same methodology that you used for the registration form: by binding a setter function to a property on the ModelLocator indicating the success of the login process. The same variable on the ModelLocator will determine whether a welcome message should be displayed and whether to redisplay the form when the user logs out.
The displaying of messages related to the login process will be handled in the login command class. This will be done by updating the userNotification property ...