mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
allow user registration for sso (#865)
This commit is contained in:
parent
4d8090d75e
commit
cd926ca8f6
@ -19,6 +19,7 @@ namespace Bit.Core.Services
|
||||
Task<DateTime> GetAccountRevisionDateByIdAsync(Guid userId);
|
||||
Task SaveUserAsync(User user, bool push = false);
|
||||
Task<IdentityResult> RegisterUserAsync(User user, string masterPassword, string token, Guid? orgUserId);
|
||||
Task<IdentityResult> RegisterUserAsync(User user);
|
||||
Task SendMasterPasswordHintAsync(string email);
|
||||
Task SendTwoFactorEmailAsync(User user);
|
||||
Task<bool> VerifyTwoFactorEmailAsync(User user, string token);
|
||||
|
@ -293,8 +293,19 @@ namespace Bit.Core.Services
|
||||
if (result == IdentityResult.Success)
|
||||
{
|
||||
await _mailService.SendWelcomeEmailAsync(user);
|
||||
await _referenceEventService.RaiseEventAsync(
|
||||
new ReferenceEvent(ReferenceEventType.Signup, user));
|
||||
await _referenceEventService.RaiseEventAsync(new ReferenceEvent(ReferenceEventType.Signup, user));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<IdentityResult> RegisterUserAsync(User user)
|
||||
{
|
||||
var result = await base.CreateAsync(user);
|
||||
if (result == IdentityResult.Success)
|
||||
{
|
||||
await _mailService.SendWelcomeEmailAsync(user);
|
||||
await _referenceEventService.RaiseEventAsync(new ReferenceEvent(ReferenceEventType.Signup, user));
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -807,7 +818,7 @@ namespace Bit.Core.Services
|
||||
PlanName = PremiumPlanId,
|
||||
});
|
||||
}
|
||||
catch when(!_globalSettings.SelfHosted)
|
||||
catch when (!_globalSettings.SelfHosted)
|
||||
{
|
||||
await paymentService.CancelAndRecoverChargesAsync(user);
|
||||
throw;
|
||||
|
@ -3,7 +3,7 @@
|
||||
[Name] NVARCHAR (50) NULL,
|
||||
[Email] NVARCHAR (50) NOT NULL,
|
||||
[EmailVerified] BIT NOT NULL,
|
||||
[MasterPassword] NVARCHAR (300) NOT NULL,
|
||||
[MasterPassword] NVARCHAR (300) NULL,
|
||||
[MasterPasswordHint] NVARCHAR (50) NULL,
|
||||
[Culture] NVARCHAR (10) NOT NULL,
|
||||
[SecurityStamp] NVARCHAR (50) NOT NULL,
|
||||
|
@ -0,0 +1,19 @@
|
||||
ALTER TABLE
|
||||
[dbo].[User]
|
||||
ALTER COLUMN
|
||||
[MasterPassword] NVARCHAR (300) NULL
|
||||
GO
|
||||
|
||||
IF EXISTS(SELECT * FROM sys.views WHERE [Name] = 'UserView')
|
||||
BEGIN
|
||||
DROP VIEW [dbo].[UserView]
|
||||
END
|
||||
GO
|
||||
|
||||
CREATE VIEW [dbo].[UserView]
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[User]
|
||||
GO
|
Loading…
x
Reference in New Issue
Block a user