Skip to content

Commit

Permalink
Feature/v4 (#184)
Browse files Browse the repository at this point in the history
Fix email validation, xamarin->maui
  • Loading branch information
bezysoftware authored Jan 8, 2023
1 parent a084edf commit f972ba9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The solution consists of 4 libraries - a base one and 3 platform specific ones:
* FirebaseAuthentication<strong>.net</strong> targets [.NET Standard 2.0](https://github.com/dotnet/standard/blob/master/docs/versions.md)
* FirebaseAuthentication<strong>.WPF</strong> targets [WPF on .NET 6](https://github.com/dotnet/wpf)
* FirebaseAuthentication<strong>.UWP</strong> targets [UWP with min version 19041](https://docs.microsoft.com/en-us/windows/uwp/updates-and-versions/choose-a-uwp-version)
* FirebaseAuthentication<strong>.Xamarin</strong> targets Xamarin.Forms (*TODO*)
* FirebaseAuthentication<strong>.Maui</strong> targets Maui (*TODO*)

## Installation

Expand All @@ -25,7 +25,7 @@ dotnet add package FirebaseAuthentication.net
# Platform specific FirebaseUI (has dependency on base package)
dotnet add package FirebaseAuthentication.WPF
dotnet add package FirebaseAuthentication.UWP
dotnet add package FirebaseAuthentication.Xamarin
dotnet add package FirebaseAuthentication.Maui
```

Use the `--version` option to specify a [preview version](https://www.nuget.org/packages/FirebaseAuthentication.net/absoluteLatest) to install.
Expand Down
16 changes: 12 additions & 4 deletions src/Auth.UI/EmailValidator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text.RegularExpressions;
using System;
using System.Net.Mail;

namespace Firebase.Auth.UI
{
Expand All @@ -9,9 +10,16 @@ public static class EmailValidator
/// </summary>
public static bool ValidateEmail(string email)
{
var regx = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
var match = regx.Match(email);
return match.Success;
try
{
var m = new MailAddress(email);

return true;
}
catch (FormatException)
{
return false;
}
}
}
}
2 changes: 1 addition & 1 deletion src/Auth/Auth.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FirebaseUI is supported by platform-specific libraries:

* FirebaseAuthentication.WPF
* FirebaseAuthentication.UWP
* FirebaseAuthentication.Xamarin
* FirebaseAuthentication.Maui
</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down

0 comments on commit f972ba9

Please sign in to comment.