1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

only check token valid if registration is disabled

This commit is contained in:
Kyle Spearrin 2018-07-13 11:04:09 -04:00
parent 938b7f1230
commit 49947e382d

View File

@ -213,7 +213,7 @@ namespace Bit.Core.Services
string token, Guid? orgUserId) string token, Guid? orgUserId)
{ {
var tokenValid = false; var tokenValid = false;
if(!string.IsNullOrWhiteSpace(token) && orgUserId.HasValue) if(_globalSettings.DisableUserRegistration && !string.IsNullOrWhiteSpace(token) && orgUserId.HasValue)
{ {
tokenValid = CoreHelpers.UserInviteTokenIsValid(_organizationServiceDataProtector, token, tokenValid = CoreHelpers.UserInviteTokenIsValid(_organizationServiceDataProtector, token,
user.Email, orgUserId.Value); user.Email, orgUserId.Value);