Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudflare-auth

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudflare-auth - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

2

demo/src/lib/constants.ts

@@ -13,2 +13,4 @@ import { AuthConfig } from 'cloudflare-auth';

salt: 'sdf82dwlWs>.s.akuidnnSwDESDh88wkk$adn@@hjk1u89pp=89b',
adminEmail: 'info@continuata.com',
adminName: 'Continuata',
};

2

package.json
{
"name": "cloudflare-auth",
"version": "1.3.0",
"version": "1.3.1",
"description": "JWT implementation for Cloudflare using D1",

@@ -5,0 +5,0 @@ "main": "src/index.ts",

@@ -0,1 +1,4 @@

import { Env } from './interfaces';
import type { AuthConfig } from './interfaces';
export const sendEmail = async (urlOrigin: string, payload: any) => {

@@ -34,3 +37,5 @@ // Mailchannels not supported on localhost so just log the email

to: string,
link: string
link: string,
env: Env,
config: AuthConfig
) => {

@@ -41,7 +46,10 @@ return await sendEmail(urlOrigin, {

to: [{ email: to }],
dkim_domain: env.DKIM_DOMAIN,
dkim_selector: env.DKIM_SELECTOR,
dkim_private_key: env.DKIM_PRIVATE_KEY,
},
],
from: {
email: 'info@continuata.co.uk',
name: 'Continuata',
email: config.adminEmail,
name: config.adminName,
},

@@ -61,3 +69,5 @@ subject: 'Verify your email address',

to: string,
link: string
link: string,
env: Env,
config: AuthConfig
) => {

@@ -68,7 +78,10 @@ return await sendEmail(urlOrigin, {

to: [{ email: to }],
dkim_domain: env.DKIM_DOMAIN,
dkim_selector: env.DKIM_SELECTOR,
dkim_private_key: env.DKIM_PRIVATE_KEY,
},
],
from: {
email: 'info@continuata.co.uk',
name: 'Continuata',
email: config.adminEmail,
name: config.adminName,
},

@@ -75,0 +88,0 @@ subject: 'Confirm login',

@@ -5,2 +5,5 @@ import * as jose from 'jose';

DB: D1Database;
DKIM_DOMAIN: string;
DKIM_SELECTOR: string;
DKIM_PRIVATE_KEY: string;
}

@@ -40,2 +43,4 @@

salt: string;
adminEmail: string;
adminName: string;
}

@@ -42,0 +47,0 @@

@@ -51,3 +51,3 @@ import { Kysely } from 'kysely';

const magicLink = `${urlOrigin}/verify?token=${token}`;
await sendLoginMagicLinkEmail(urlOrigin, email, magicLink);
await sendLoginMagicLinkEmail(urlOrigin, email, magicLink, env, config);
return magicLink;

@@ -54,0 +54,0 @@ };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc