     return
 
 server.get '/signout', (request, response) ->
-    user.username = 'guest'
+    request.session.auth.user.username = 'guest'
     request.session.destroy();
     response.redirect '/about'
 

    return

server.get '/meeting/:uuid', (request, response) ->
    console.log('open meeting: ' + request.params.uuid + ' - '+ user.username );
    if user.username == 'guest' then return response.redirect '/signin'
    return fs.readFile "#{process.cwd()}/templates/meeting.html", "utf-8", (err, data) ->
        document = jsdom.jsdom data
        window = document.createWindow()
        jQ = jQuery.create window

        writeUser user, jQ

        # Write the Meeting identifier into the DOM
        jQ('[typeof="rdfcal\\:Vevent"]').attr('about', request.params.uuid);


# Serve the home page
server.get '/', (request, response) ->
    if request.isAuthenticated() then return response.redirect '/dashboard' else return response.redirect '/signin'

server.get '/about', (request, response) ->
    response.sendfile "#{process.cwd()}/templates/about.html"

server.get '/signin', (request,response) ->
    if request.isAuthenticated() then return response.redirect '/dashboard'
    
    request.authenticate ['twitter'], (error, authenticated) ->
        if request.isAuthenticated()
            jsonUrl = "https://api.twitter.com/1/users/show.json?screen_name="+request.session.auth.user.username
            
            ProxyRequest {uri:jsonUrl}, (error, ProxyResponse, body) ->
                if !error and ProxyResponse.statusCode == 200
                    userData = JSON.parse(body)
                    request.session.auth.user.image = userData.profile_image_url
                    request.session.auth.user.homepage = userData.url
                    request.session.auth.user.name = userData.name
                    return response.redirect '/dashboard'
                else
                    # write info message about error
