1
0
mirror of https://github.com/dani/vroom.git synced 2024-06-23 01:59:13 +02:00

Add a new etherpadBaseDomain param so you can set the domain for etherpad Cookie

This commit is contained in:
Daniel Berteaud 2014-06-13 14:19:02 +02:00
parent c1418e3aee
commit 109f4380da
2 changed files with 11 additions and 3 deletions

View File

@ -41,8 +41,11 @@ chromeExtensionId => 'ecicdpoejfllflombfanbhfpgcimjddn',
# For etherpad integration, set the etherpad base url
# and API Key
etherpadUri => '',
etherpadApiKey => '',
#etherpadUri => '',
#etherpadApiKey => '',
# You can also set the base domain common to both vroom and etherpad
# For example, if you use vroom.example.com and pad.example.com, the base domain is example.com
#etherpadBaseDomaine => '',
# Various
sendmail => '/sbin/sendmail'

View File

@ -126,6 +126,7 @@ our $config = plugin Config => {
chromeExtensionId => 'ecicdpoejfllflombfanbhfpgcimjddn',
etherpadUri => '',
etherpadApiKey => '',
etherpadBaseDomain => '',
sendmail => '/sbin/sendmail'
}
};
@ -862,7 +863,11 @@ get '/(*room)' => sub {
$self->session($room)->{etherpadAuthorId} = $id;
my $etherpadSession = $ec->create_session($data->{etherpad_group}, $id, time + 86400);
$self->session($room)->{etherpadSessionId} = $etherpadSession;
$self->cookie(sessionID => $etherpadSession);
my $etherpadCookieParam = {};
if ($config->{etherpadBaseDomain} && $config->{etherpadBaseDomain} ne ''){
$etherpadCookieParam->{domain} = $config->{etherpadBaseDomain};
}
$self->cookie(sessionID => $etherpadSession, $etherpadCookieParam);
}
# Short life cookie to negociate a session with the signaling server
$self->cookie(vroomsession => encode_base64($self->session('name') . ':' . $data->{name} . ':' . $data->{token}, ''), {expires => time + 60, path => '/'});