Skip to content

Instantly share code, notes, and snippets.

@mauricio
Created July 18, 2012 18:59
Show Gist options
  • Select an option

  • Save mauricio/3138090 to your computer and use it in GitHub Desktop.

Select an option

Save mauricio/3138090 to your computer and use it in GitHub Desktop.
public static Model.ServerMessage Login(string username, string password)
{
return UserResource.Login( username, password ).Fold(
( message ) => {
EndSession();
return message;
},
( user) => {
_instance = new Session();
_instance.SetCredentials(user);
StoreCredentials(username, password);
RaiseLoggedInEvent();
return Model.ServerMessage.LoggedInMessage;
} );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment