Skip to content

Commit

Permalink
add indicator to login result for new registration
Browse files Browse the repository at this point in the history
  • Loading branch information
joeaudette committed Sep 21, 2017
1 parent c0c11c0 commit 5b08907
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cloudscribe.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.12
VisualStudioVersion = 15.0.26730.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9C16B47A-B712-4237-B62F-B4403ACF1CD5}"
EndProject
Expand Down
3 changes: 3 additions & 0 deletions notes/analytics.md
Expand Up @@ -21,6 +21,9 @@ PII Viewer for Google Analytics is a Google Chrome extension which allows you to
https://davidsimpson.me/pii-viewer-for-google-analytics/
https://davidsimpson.me/2014/04/20/tutorial-send-user-ids-google-analytics/


http://www.charlesfarina.com/login-and-signup-naming-conventions-for-google-analytics/

## Tracking code notes

https://support.google.com/analytics/answer/1033863?visit_id=1-636413345736273758-1215674834&rd=1
Expand Down
4 changes: 4 additions & 0 deletions notes/favicons.md
@@ -0,0 +1,4 @@


https://realfavicongenerator.net/

14 changes: 13 additions & 1 deletion notes/telemtry.md
Expand Up @@ -12,4 +12,16 @@ https://www.youtube.com/watch?v=iNMYiKGa5E4
https://azure.microsoft.com/en-us/blog/integrating-application-insights-into-a-modular-cms-and-a-multi-tenant-public-saas/

How to disable application insights in asp.net core 2.0
https://github.com/aspnet/Home/issues/2051#issuecomment-326288247
https://github.com/aspnet/Home/issues/2051#issuecomment-326288247

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-asp-net-core

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-asp-net#run

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-javascript

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-monitor-performance-live-website-now

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-api-custom-events-metrics

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-asp-net-trace-logs
5 changes: 5 additions & 0 deletions src/cloudscribe.Core.Identity/LoginResultTemplate.cs
Expand Up @@ -6,6 +6,10 @@ namespace cloudscribe.Core.Identity
{
public class LoginResultTemplate
{
public LoginResultTemplate()
{
RejectReasons = new List<string>();
}
public bool MustAcceptTerms { get; set; }
public bool NeedsAccountApproval { get; set; }
public bool NeedsEmailConfirmation { get; set; }
Expand All @@ -14,6 +18,7 @@ public class LoginResultTemplate
public ExternalLoginInfo ExternalLoginInfo { get; set; } = null;
public List<string> RejectReasons { get; set; } = new List<string>();
public SiteUser User { get; set; } = null;
public bool IsNewUserRegistration { get; set; }
public SignInResult SignInResult { get; set; } = SignInResult.Failed;
}
}
20 changes: 12 additions & 8 deletions src/cloudscribe.Core.Identity/UserLoginResult.cs
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Author: Joe Audette
// Created: 2017-05-22
// Last Modified: 2017-05-24
// Last Modified: 2017-09-21
//

using cloudscribe.Core.Models;
Expand All @@ -15,13 +15,14 @@ public class UserLoginResult
{
public UserLoginResult(
SignInResult signInResult,
List<string> rejectReasons = null,
IUserContext user = null,
bool mustAcceptTerms = false,
bool needsAccountApproval = false,
bool needsEmailConfirmation = false,
string emailConfirmationToken = "",
bool needsPhoneConfirmation = false,
List<string> rejectReasons,
IUserContext user,
bool isNewUserRegistration,
bool mustAcceptTerms,
bool needsAccountApproval,
bool needsEmailConfirmation,
string emailConfirmationToken,
bool needsPhoneConfirmation,
ExternalLoginInfo externalLoginInfo = null
)
{
Expand All @@ -33,6 +34,7 @@ public class UserLoginResult
RejectReasons = new List<string>();
}
User = user;
IsNewUserRegistration = isNewUserRegistration;
MustAcceptTerms = mustAcceptTerms;
NeedsAccountApproval = needsAccountApproval;
NeedsEmailConfirmation = needsEmailConfirmation;
Expand Down Expand Up @@ -63,6 +65,8 @@ public class UserLoginResult
public List<string> RejectReasons { get; }

public IUserContext User { get; }

public bool IsNewUserRegistration { get; }
}

}
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>asp.net identity implementation for cloudscribe web application foundation</Description>
<VersionPrefix>2.0.3</VersionPrefix>
<VersionPrefix>2.0.4</VersionPrefix>
<Authors>Joe Audette</Authors>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AssemblyName>cloudscribe.Core.Identity</AssemblyName>
Expand Down
7 changes: 6 additions & 1 deletion src/cloudscribe.Core.Web/Components/AccountService.cs
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Author: Joe Audette
// Created: 2017-05-22
// Last Modified: 2017-07-27
// Last Modified: 2017-09-20
//

using cloudscribe.Core.Identity;
Expand Down Expand Up @@ -123,6 +123,7 @@ public async Task<UserLoginResult> TryExternalLogin(string providedEmail = "", b
if (template.User == null)
{
template.User = await CreateUserFromExternalLogin(template.ExternalLoginInfo, email, didAcceptTerms);
if(template.User != null) { template.IsNewUserRegistration = true; }
}
}

Expand Down Expand Up @@ -155,6 +156,7 @@ public async Task<UserLoginResult> TryExternalLogin(string providedEmail = "", b
template.SignInResult,
template.RejectReasons,
userContext,
template.IsNewUserRegistration,
template.MustAcceptTerms,
template.NeedsAccountApproval,
template.NeedsEmailConfirmation,
Expand Down Expand Up @@ -226,6 +228,7 @@ public async Task<UserLoginResult> TryLogin(LoginViewModel model)
template.SignInResult,
template.RejectReasons,
userContext,
template.IsNewUserRegistration,
template.MustAcceptTerms,
template.NeedsAccountApproval,
template.NeedsEmailConfirmation,
Expand Down Expand Up @@ -284,6 +287,7 @@ IHandleCustomRegistration customRegistration
if (result.Succeeded)
{
template.User = user;
template.IsNewUserRegistration = true;
await loginRulesProcessor.ProcessAccountLoginRules(template);
}
else
Expand Down Expand Up @@ -314,6 +318,7 @@ IHandleCustomRegistration customRegistration
template.SignInResult,
template.RejectReasons,
userContext,
template.IsNewUserRegistration,
template.MustAcceptTerms,
template.NeedsAccountApproval,
template.NeedsEmailConfirmation,
Expand Down
4 changes: 3 additions & 1 deletion src/cloudscribe.Core.Web/StartupExtensions.cs
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Author: Joe Audette
// Created: 2016-05-07
// Last Modified: 2017-08-02
// Last Modified: 2017-09-20
//


Expand Down Expand Up @@ -70,6 +70,8 @@ public static IServiceCollection AddCloudscribeCore(this IServiceCollection serv
services.TryAddScoped<IHandleCustomUserInfo, NoUserInfoCustomization>();
services.TryAddScoped<IHandleCustomUserInfoAdmin, NoUserEditCustomization>();

//services.TryAddScoped<IServerSideTelemetry, NoopServerSideTelemetry>();

//

//
Expand Down
2 changes: 1 addition & 1 deletion src/cloudscribe.Core.Web/cloudscribe.Core.Web.csproj
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Multi-tenant web application foundation with management for sites, users, roles, claims, and geographic data.</Description>
<VersionPrefix>2.0.7</VersionPrefix>
<VersionPrefix>2.0.8</VersionPrefix>
<Authors>Joe Audette</Authors>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AssemblyName>cloudscribe.Core.Web</AssemblyName>
Expand Down

0 comments on commit 5b08907

Please sign in to comment.