From 1c7cc797687e51b55c93edeeefa96add7f7b6e49 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 13 May 2014 23:23:02 +0200 Subject: [PATCH] Only grant the owner role if creation succedded --- public/vroom.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/vroom.pl b/public/vroom.pl index 6886476..e69c3d5 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -316,7 +316,6 @@ post '/create' => sub { $self->res->headers->cache_control('max-age=1, no-cache'); my $name = $self->param('roomName') || $self->get_random_name(); $self->login; - $self->session($name => {role => 'owner'}); unless ($self->valid_room_name($name)){ return $self->render('error', room => $name, @@ -333,6 +332,7 @@ post '/create' => sub { ); } else{ + $self->session($name => {role => 'owner'}); $self->redirect_to($self->url_for('/') . $name); } };