Redirect to drive anonymous users trying to create a profile

pull/1/head
yflory 2018-04-18 18:53:36 +02:00
parent caf86dd9b7
commit 1f3f4941b5
1 changed files with 5 additions and 1 deletions

View File

@ -53,7 +53,11 @@ define([
return void cb(null, Hash.getSecrets('profile', editHash));
}
// 3rd case: profile creation (create a new random hash, store it later if needed)
if (!Utils.LocalStore.isLoggedIn()) { return void cb(); }
if (!Utils.LocalStore.isLoggedIn()) {
// Unregistered users can't create a profile
window.location.href = '/drive';
return void cb();
}
var hash = Hash.createRandomHash();
var secret = Hash.getSecrets('profile', hash);
Cryptpad.pinPads([secret.channel], function (e) {