mirror of
https://github.com/MAKS-IT-COM/maksit-postclient.git
synced 2026-09-30 03:18:09 +02:00
20 lines
588 B
C#
20 lines
588 B
C#
namespace MaksIT.PostClient.Shared.Auth;
|
|
|
|
|
|
public static class OAuthLoginHint {
|
|
public static string? For(string? authKind, string? address) {
|
|
var hint = (address ?? "").Trim();
|
|
if (hint.Length == 0)
|
|
return null;
|
|
var kind = MailAuthKind.Normalize(authKind);
|
|
if (kind == MailAuthKind.Microsoft)
|
|
return hint;
|
|
if (kind != MailAuthKind.Google)
|
|
return null;
|
|
if (hint.EndsWith("@gmail.com", StringComparison.OrdinalIgnoreCase)
|
|
|| hint.EndsWith("@googlemail.com", StringComparison.OrdinalIgnoreCase))
|
|
return hint;
|
|
return null;
|
|
}
|
|
}
|