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

	response.render 'profile', options


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

	else
		response.redirect '/login/'

mustNotBeAuthed = (request, response, next) ->
	if request.uonline.basicOpts.loggedIn is true
		response.redirect config.defaultInstanceForUsers
	else
		next()


app.use ((request, response) ->
	# Read basic stuff
