From 6cb9bcc761a6bfbebcbf42a8c7d4be302da5f6bd Mon Sep 17 00:00:00 2001 From: Bernat Romagosa Date: Tue, 20 Feb 2018 02:05:36 +0100 Subject: [PATCH] Checking if user is verified on session init --- cloud.js | 1 + gui.js | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/cloud.js b/cloud.js index c731c07f..5234363a 100755 --- a/cloud.js +++ b/cloud.js @@ -208,6 +208,7 @@ Cloud.prototype.checkCredentials = function (onSuccess, onError, response) { function (user) { if (user.username) { myself.username = user.username; + myself.verified = user.verified; } if (onSuccess) { onSuccess.call( diff --git a/gui.js b/gui.js index 7295fb79..98006abe 100644 --- a/gui.js +++ b/gui.js @@ -276,6 +276,22 @@ IDE_Morph.prototype.openIn = function (world) { function (username) { if (username) { myself.source = 'cloud'; + if (!SnapCloud.verified) { + new DialogBoxMorph().inform( + 'Unverified account', + 'Your account is still unverified.\n' + + 'Please use the verification link that\n' + + 'was sent to your email address when you\n' + + 'signed up.\n\n' + + 'If you cannot find that email, please\n' + + 'check your spam folder. If you still\n' + + 'cannot find it, please use the "Resend\n' + + 'Verification Email..." option in the cloud\n' + + 'menu.', + world, + myself.cloudIcon(null, new Color(0, 180, 0)) + ); + } } } ); @@ -5161,11 +5177,16 @@ IDE_Morph.prototype.initializeCloud = function () { if (!isNil(response.days_left)) { new DialogBoxMorph().inform( 'Unverified account: ' + response.days_left + ' days left', - 'You are now logged in, but your account\n' + - 'has not been verified yet.\n' + + 'You are now logged in, and your account\n' + + 'is enabled for three days.\n' + 'Please use the verification link that\n' + 'was sent to your email address when you\n' + 'signed up.\n\n' + + 'If you cannot find that email, please\n' + + 'check your spam folder. If you still\n' + + 'cannot find it, please use the "Resend\n' + + 'Verification Email..." option in the cloud\n' + + 'menu.\n\n' + 'You have ' + response.days_left + ' days left.', world, myself.cloudIcon(null, new Color(0, 180, 0))