Add a sign out functionality

The permament branch is still not working as expected.