 		response.render 'register', options
 
 
-app.get '/login/', (request, response) ->
+app.get '/login/', mustNotBeAuthed, (request, response) ->
 	quickRender request, response, 'login'
 
 
-app.post '/login/', (request, response) ->
+app.post '/login/', mustNotBeAuthed, (request, response) ->
 	if lib.user.accessGranted.sync null, dbConnection, request.body.user, request.body.pass
 		sessid = lib.user.createSession.sync null, dbConnection, request.body.user
 		response.cookie 'sessid', sessid

	quickRender request, response, 'about'


app.get '/register/', (request, response) ->
	quickRender request, response, 'register'


app.post '/register/', (request, response) ->
	options = request.uonline.basicOpts
	options.instance = 'register'
	usernameIsValid = lib.validation.usernameIsValid(request.body.user)

	response.render 'profile', options


app.get '/action/logout', mustBeAuthed, (request, response) ->
	# TODO: move sessid to uonline{}
	lib.user.closeSession dbConnection, request.cookies.sessid, (error, result) ->
		if error?
