Skip to content

Commit

Permalink
EmailField as default username
Browse files Browse the repository at this point in the history
  • Loading branch information
robson-paproski committed Jan 25, 2016
1 parent 7b604ce commit c63893b
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{877369D7-D17B-4B02-9385-47CEE6E2784D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{877369D7-D17B-4B02-9385-47CEE6E2784D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{877369D7-D17B-4B02-9385-47CEE6E2784D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{877369D7-D17B-4B02-9385-47CEE6E2784D}.Release|Any CPU.Build.0 = Release|Any CPU
{2A0039A4-F3C0-4652-AC75-A54775287C10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A0039A4-F3C0-4652-AC75-A54775287C10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A0039A4-F3C0-4652-AC75-A54775287C10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A0039A4-F3C0-4652-AC75-A54775287C10}.Release|Any CPU.Build.0 = Release|Any CPU
{877369D7-D17B-4B02-9385-47CEE6E2784D}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{877369D7-D17B-4B02-9385-47CEE6E2784D}.Release|Any CPU.Build.0 = Debug|Any CPU
{2A0039A4-F3C0-4652-AC75-A54775287C10}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{2A0039A4-F3C0-4652-AC75-A54775287C10}.Debug|Any CPU.Build.0 = Release|Any CPU
{2A0039A4-F3C0-4652-AC75-A54775287C10}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{2A0039A4-F3C0-4652-AC75-A54775287C10}.Release|Any CPU.Build.0 = Debug|Any CPU
{2A0039A4-F3C0-4652-AC75-A54775287C10}.Release|Any CPU.Deploy.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>

<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>2a0039a4-f3c0-4652-ac75-a54775287c10</ProjectGuid>
<RootNamespace>AspNet.Identity3.PostgreSQL</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
</Project>
4 changes: 2 additions & 2 deletions src/AspNet.Identity3.PostgreSQL/Tables/UserTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public TUser GetUserByUserName(string userName)
{
if (userName != null)
userName = userName.ToLower();

string commandText = "SELECT * FROM " + fullTableName + " WHERE lower(" + FieldUserName.Quoted() + ") = @name";
//take in email field
string commandText = "SELECT * FROM " + fullTableName + " WHERE lower(" + FieldEmail.Quoted() + ") = @name";
Dictionary<string, object> parameters = new Dictionary<string, object>() { { "@name", userName } };

var row = _database.ExecuteQueryGetSingleRow(commandText, parameters);
Expand Down
2 changes: 1 addition & 1 deletion src/AspNet.Identity3.PostgreSQL/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.0-beta1",
"version": "1.0.1-beta1",
"description": "AspNet.Identity3.PostgreSQL Class Library",
"authors": [ "robso" ],
"tags": [ "" ],
Expand Down
101 changes: 101 additions & 0 deletions src/WebTest/Properties/PublishProfiles/Test-publish.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
[cmdletbinding(SupportsShouldProcess=$true)]
param($publishProperties, $packOutput, $nugetUrl)

# to learn more about this file visit http://go.microsoft.com/fwlink/?LinkId=524327
$publishModuleVersion = '1.0.1'
function Get-VisualStudio2015InstallPath{
[cmdletbinding()]
param()
process{
$keysToCheck = @('hklm:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0',
'hklm:\SOFTWARE\Microsoft\VisualStudio\14.0',
'hklm:\SOFTWARE\Wow6432Node\Microsoft\VWDExpress\14.0',
'hklm:\SOFTWARE\Microsoft\VWDExpress\14.0'
)
[string]$vsInstallPath=$null

foreach($keyToCheck in $keysToCheck){
if(Test-Path $keyToCheck){
$vsInstallPath = (Get-itemproperty $keyToCheck -Name InstallDir -ErrorAction SilentlyContinue | select -ExpandProperty InstallDir -ErrorAction SilentlyContinue)
}

if($vsInstallPath){
break;
}
}

$vsInstallPath
}
}

$vsInstallPath = Get-VisualStudio2015InstallPath
$publishModulePath = "{0}Extensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion

if(!(Test-Path $publishModulePath)){
$publishModulePath = "{0}VWDExpressExtensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion
}

$defaultPublishSettings = New-Object psobject -Property @{
LocalInstallDir = $publishModulePath
}

function Enable-PackageDownloader{
[cmdletbinding()]
param(
$toolsDir = "$env:LOCALAPPDATA\Microsoft\Web Tools\Publish\package-downloader-$publishModuleVersion\",
$pkgDownloaderDownloadUrl = 'http://go.microsoft.com/fwlink/?LinkId=524325') # package-downloader.psm1
process{
if(get-module package-downloader){
remove-module package-downloader | Out-Null
}

if(!(get-module package-downloader)){
if(!(Test-Path $toolsDir)){ New-Item -Path $toolsDir -ItemType Directory -WhatIf:$false }

$expectedPath = (Join-Path ($toolsDir) 'package-downloader.psm1')
if(!(Test-Path $expectedPath)){
'Downloading [{0}] to [{1}]' -f $pkgDownloaderDownloadUrl,$expectedPath | Write-Verbose
(New-Object System.Net.WebClient).DownloadFile($pkgDownloaderDownloadUrl, $expectedPath)
}

if(!$expectedPath){throw ('Unable to download package-downloader.psm1')}

'importing module [{0}]' -f $expectedPath | Write-Output
Import-Module $expectedPath -DisableNameChecking -Force
}
}
}

function Enable-PublishModule{
[cmdletbinding()]
param()
process{
if(get-module publish-module){
remove-module publish-module | Out-Null
}

if(!(get-module publish-module)){
$localpublishmodulepath = Join-Path $defaultPublishSettings.LocalInstallDir 'publish-module.psm1'
if(Test-Path $localpublishmodulepath){
'importing module [publish-module="{0}"] from local install dir' -f $localpublishmodulepath | Write-Verbose
Import-Module $localpublishmodulepath -DisableNameChecking -Force
$true
}
}
}
}

try{

if (!(Enable-PublishModule)){
Enable-PackageDownloader
Enable-NuGetModule -name 'publish-module' -version $publishModuleVersion -nugetUrl $nugetUrl
}

'Calling Publish-AspNet' | Write-Verbose
# call Publish-AspNet to perform the publish operation
Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput
}
catch{
"An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error
}
26 changes: 26 additions & 0 deletions src/WebTest/Properties/PublishProfiles/Test.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<CompileSource>False</CompileSource>
<_DefaultDNXVersion>dnx-clr-win-x86.1.0.0-rc1-update1</_DefaultDNXVersion>
<UsePowerShell>True</UsePowerShell>
<IISCommand>web</IISCommand>
<WebRoot>wwwroot</WebRoot>
<WwwRootOut>wwwroot</WwwRootOut>
<IncludeSymbols>False</IncludeSymbols>
<Native>False</Native>
<IgnoreDNXRuntime>False</IgnoreDNXRuntime>
<publishUrl>C:\Identity3</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/WebTest/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"DefaultConnection": "Server = localhost; Port = 5432; Database = **; User Id = postgres; Password = **"
"DefaultConnection": "Server = ; Port = 5432; Database = ; User Id = ; Password = "
}
1 change: 1 addition & 0 deletions src/WebTest/wwwroot/css/site.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.

0 comments on commit c63893b

Please sign in to comment.