Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.0.1a4] - 2025-12-05
### Added
- Added support for Clerk Provider themes, as well as ids for support with callbacks

## Fixed
- Fixed issue with DashAuth components not being available

## [0.0.1a3] - 2025-11-25
## Fixed
- Fixed issue with Clerk components missing and also adding necessary session data to callback for login.
Expand Down
2 changes: 1 addition & 1 deletion dash_auth_plus/clerk_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def add_clerk_script(index_string):
if not self.initialized:
return index_string

if clerk_script and "</head>" in index_string:
if self.clerk_script and "</head>" in index_string:
# Inject scripts and styles before closing head tag
index_string = index_string.replace(
"</head>",
Expand Down
1 change: 1 addition & 0 deletions dash_auth_plus/package-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"devDependencies": {
"@babel/core": "^7.24.5",
"@clerk/clerk-react": "^5.2.10",
"@clerk/themes": "^2.4.42",
"@types/ramda": "^0.30.1",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
Expand Down
37 changes: 26 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"devDependencies": {
"@babel/core": "^7.24.5",
"@clerk/clerk-react": "^5.2.10",
"@clerk/themes": "^2.4.42",
"@types/ramda": "^0.30.1",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
Expand Down
30 changes: 28 additions & 2 deletions src/ts/components/ClerkProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,42 @@
import React, { PropsWithChildren } from "react";
import { ClerkProvider as ClerkClerkProvider } from '@clerk/clerk-react'
import { dark, neobrutalism } from '@clerk/themes'

const themes = {
'dark': dark,
'neobrutalism': neobrutalism
};
Comment thread
BSd3v marked this conversation as resolved.

export interface ClerkProviderProps {
PUBLISHABLE_KEY: string;
afterSignOutUrl?: string;
children: React.ReactNode;
themeName?: string;
id?: string;
[key: string]: any;
Comment thread
BSd3v marked this conversation as resolved.
}


const ClerkProvider: React.FC<PropsWithChildren<ClerkProviderProps>> = ({ PUBLISHABLE_KEY, afterSignOutUrl, children, ...others }) => {
const ClerkProvider: React.FC<PropsWithChildren<ClerkProviderProps>> = ({
PUBLISHABLE_KEY,
afterSignOutUrl,
children,
themeName,
...others
}) => {

const appearance = React.useMemo(() => {
const theme = themeName ? themes[themeName as keyof typeof themes] : undefined;
return theme ? { baseTheme: theme } : undefined;
}, [themeName]);

return (
<ClerkClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl={afterSignOutUrl}>
<ClerkClerkProvider
publishableKey={PUBLISHABLE_KEY}
afterSignOutUrl={afterSignOutUrl}
appearance={appearance}
{...others}
>
{children}
</ClerkClerkProvider>
);
Expand Down