remix-auth-auth0
Advanced tools
Comparing version 1.5.1 to 1.6.0
@@ -11,2 +11,3 @@ import { OAuth2Profile, OAuth2Strategy, OAuth2StrategyVerifyParams } from "remix-auth-oauth2"; | ||
organization?: string; | ||
connection?: string; | ||
} | ||
@@ -52,2 +53,3 @@ export interface Auth0ExtraParams extends Record<string, unknown> { | ||
private organization?; | ||
private connection?; | ||
private fetchProfile; | ||
@@ -54,0 +56,0 @@ constructor(options: Auth0StrategyOptions, verify: StrategyVerifyCallback<User, OAuth2StrategyVerifyParams<Auth0Profile, Auth0ExtraParams>>); |
@@ -20,2 +20,3 @@ "use strict"; | ||
this.organization = options.organization; | ||
this.connection = options.connection; | ||
this.fetchProfile = /(^| )openid($| )/.test(this.scope); | ||
@@ -29,2 +30,4 @@ } | ||
params.set("organization", this.organization); | ||
if (this.connection) | ||
params.set("connection", this.connection); | ||
return params; | ||
@@ -31,0 +34,0 @@ } |
{ | ||
"name": "remix-auth-auth0", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"main": "./build/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./build/index.d.ts", |
@@ -60,9 +60,9 @@ # Auth0Strategy | ||
// app/routes/auth/auth0.tsx | ||
import type { ActionFunction, LoaderFunction } from "@remix-run/node"; | ||
import type { ActionArgs } from "@remix-run/node"; | ||
import { authenticator } from "~/utils/auth.server"; | ||
export let loader: LoaderFunction = () => redirect("/login"); | ||
export let loader = () => redirect("/login"); | ||
export let action: ActionFunction = ({ request }) => { | ||
export let action = ({ request }: ActionArgs) => { | ||
return authenticator.authenticate("auth0", request); | ||
@@ -74,7 +74,7 @@ }; | ||
// app/routes/auth/auth0/callback.tsx | ||
import type { ActionFunction, LoaderFunction } from "@remix-run/node"; | ||
import type { LoaderArgs } from "@remix-run/node"; | ||
import { authenticator } from "~/utils/auth.server"; | ||
export let loader: LoaderFunction = ({ request }) => { | ||
export let loader = ({ request }: LoaderArgs) => { | ||
return authenticator.authenticate("auth0", request, { | ||
@@ -88,3 +88,3 @@ successRedirect: "/dashboard", | ||
```tsx | ||
import type { ActionFunction } from "@remix-run/node"; | ||
import type { ActionArgs } from "@remix-run/node"; | ||
@@ -95,3 +95,3 @@ import { redirect } from "@remix-run/node"; | ||
export const action: ActionFunction = async ({ request }) => { | ||
export const action = async ({ request }: ActionArgs) => { | ||
const session = await getSession(request.headers.get("Cookie")); | ||
@@ -98,0 +98,0 @@ const logoutURL = new URL(process.env.AUTH0_LOGOUT_URL); |
10006
130