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

@clearfor/remix-auth-auth0

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clearfor/remix-auth-auth0 - npm Package Compare versions

Comparing version 1.0.0-beta.2 to 1.0.0-beta.3

39

build/index.d.ts
import { type SetCookieInit } from "@mjackson/headers";
import { Auth0, type OAuth2Tokens } from "arctic";
import { type OAuth2Tokens } from "arctic";
import { Strategy } from "remix-auth/strategy";

@@ -46,2 +46,35 @@ type URLConstructor = ConstructorParameters<typeof URL>[0];

};
export interface Auth0Profile {
id: string;
displayName?: string;
name?: {
familyName?: string;
givenName?: string;
middleName?: string;
};
emails?: {
value: string;
}[];
photos?: {
value: string;
}[];
organizationId?: string;
organizationName?: string;
_json: Auth0UserInfo;
}
export interface Auth0UserInfo {
sub: string;
name?: string;
family_name?: string;
given_name?: string;
middle_name?: string;
nickname?: string;
profile?: string;
picture?: string;
website?: string;
email?: string;
email_verified: boolean;
org_id?: string;
org_name?: string;
}
interface VerifyOptions {

@@ -56,3 +89,4 @@ /** The request that triggered the verification flow */

name: string;
protected client: Auth0;
private client;
private userInfoURL;
constructor(options: Auth0Options, verify: Strategy.VerifyFunction<User, VerifyOptions>);

@@ -103,3 +137,4 @@ private get cookieName();

revokeToken(token: string): Promise<void>;
userProfile(accessToken: string): Promise<Auth0Profile>;
}
export {};

@@ -13,5 +13,7 @@ import {} from "@mjackson/headers";

client;
userInfoURL;
constructor(options, verify) {
super(verify);
this.options = options;
this.userInfoURL = `https://${options.domain}/userinfo`;
this.client = new Auth0(options.domain, options.clientId, options.clientSecret, options.redirectURI.toString());

@@ -128,3 +130,41 @@ }

}
async userProfile(accessToken) {
let response = await fetch(this.userInfoURL, {
headers: { Authorization: `Bearer ${accessToken}` },
});
let data = await response.json();
let profile = {
id: data.sub,
_json: data,
};
if (data.name) {
profile.displayName = data.name;
}
if (data.family_name || data.given_name || data.middle_name) {
profile.name = {};
if (data.family_name) {
profile.name.familyName = data.family_name;
}
if (data.given_name) {
profile.name.givenName = data.given_name;
}
if (data.middle_name) {
profile.name.middleName = data.middle_name;
}
}
if (data.email) {
profile.emails = [{ value: data.email }];
}
if (data.picture) {
profile.photos = [{ value: data.picture }];
}
if (data.org_id) {
profile.organizationId = data.org_id;
}
if (data.org_name) {
profile.organizationName = data.org_name;
}
return profile;
}
}
//# sourceMappingURL=index.js.map

2

package.json
{
"name": "@clearfor/remix-auth-auth0",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"description": "Remix auth wrapper for Auth0",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

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