Complete the log in/out functionality