Skip to content

Instantly share code, notes, and snippets.

View jtrimm007's full-sized avatar
💫

Joshua Trimm jtrimm007

💫
View GitHub Profile
@jtrimm007
jtrimm007 / TokenMaker.cs
Created December 29, 2021 21:16
How to Create a Custom Token for Authentication
var secretKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("KeyForSignInSecret@1234"));
var signinCredentials = new SigningCredentials(secretKey, SecurityAlgorithms.HmacSha256);
var tokeOptions = new JwtSecurityToken(
issuer: url,
audience: url,
claims: new List<Claim>(),
expires: DateTime.Now.AddMinutes(30),
signingCredentials: signinCredentials
);
@jtrimm007
jtrimm007 / gist:ad00cf3d815ed9d3bd06736b997ced88
Created January 27, 2024 14:03
Custom Stripe enums string converter
public enum BusinessType
{
Proprietorship, SingleMemberLLC, Corporation
}
public static string ConvertToStripe(this BusinessType businessType)
{
switch (businessType)
{
case BusinessType.Proprietorship: