mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
14 lines
484 B
C#
14 lines
484 B
C#
using System.Threading;
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
using System.Linq;
|
|
|
|
namespace System.Security.Claims
|
|
{
|
|
public static class ClaimsPrincipalExtensions
|
|
{
|
|
private readonly static string[] SUBSCRIBED_CLAIMS = ["believer", "education", "essential", "pro", "legacy_pro"];
|
|
public static bool IsUserSubscribed(this ClaimsPrincipal user)
|
|
=> user.Claims.Any((c) => c.Type == "notesnook:status" && SUBSCRIBED_CLAIMS.Contains(c.Value));
|
|
}
|
|
} |