Skip to content

Commit dd3eb65

Browse files
committed
fix minor styling issues
1 parent 7e8922f commit dd3eb65

File tree

16 files changed

+754
-304
lines changed

16 files changed

+754
-304
lines changed

CLAUDE.md

Lines changed: 121 additions & 77 deletions
Large diffs are not rendered by default.

auth4genai/intro/asynchronous-authorization.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ This process relies on a decoupled authentication flow where the user provides c
77

88
<Frame>
99
<iframe
10-
width="590px"
11-
height="330px"
1210
src="https://play.vidyard.com/tHw62YdhKaUCRrmLheT1dE.html"
1311
title="Asynchronous authorization with Auth0 for AI Agents"
1412
frameborder="0"
1513
allow="accelerometer; autoplay; gyroscope; picture-in-picture; fullscreen"
1614
referrerpolicy="no-referrer-when-downgrade"
1715
allowfullscreen
18-
/>
16+
className="aspect-video object-cover w-full h-full"
17+
/>
18+
1919
</Frame>
2020

2121
## Use cases for asynchronous authorization

auth4genai/intro/authorization-for-rag.mdx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ description: "Authorization for Retrieval-Augmented Generation (RAG) ensures tha
55

66
<Frame>
77
<iframe
8-
width="590px"
9-
height="330px"
108
src="https://play.vidyard.com/TCAzaPdj4SEp9yXTbgPP1W.html"
119
title="Authorization for RAG using Auth0 FGA"
1210
frameborder="0"
1311
allow="accelerometer; autoplay; gyroscope; picture-in-picture; fullscreen"
1412
referrerpolicy="no-referrer-when-downgrade"
1513
allowfullscreen
14+
className="aspect-video object-cover w-full h-full"
1615
/>
1716
</Frame>
1817

@@ -61,11 +60,11 @@ The process works as follows:
6160
`document:2024-financials`.
6261
</Step>
6362
<Step title="Fetch and filter">
64-
When a user submits a query to your AI agent, your backend first
65-
fetches relevant documents from a vector database and then makes a
66-
permission check call to Auth0 FGA. This call asks, "Is this user allowed to
67-
view these documents?". Our AI framework SDKs abstract this and make it as
68-
easy as plugging in a filter in your retriever tool.
63+
When a user submits a query to your AI agent, your backend first fetches
64+
relevant documents from a vector database and then makes a permission check
65+
call to Auth0 FGA. This call asks, "Is this user allowed to view these
66+
documents?". Our AI framework SDKs abstract this and make it as easy as
67+
plugging in a filter in your retriever tool.
6968
</Step>
7069
<Step title="Secure retrieval">
7170
Auth0 FGA determines if the user is authorized to access the documents. Your

auth4genai/intro/overview.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Follow our [quickstart guides](/get-started/overview) for a step-by-step tutoria
4242

4343
Explore our sample applications and templates
4444

45-
<Columns cols={3}>
45+
<Columns cols={1}>
4646
<Card href="https://github.com/auth0-samples/auth0-assistant0" title="Assistant0" vertical>
4747
A fullstack AI personal assistant with pre-configured tools that
4848
demonstrates different Auth0 for AI Agents features like User Authentication,
@@ -64,6 +64,7 @@ Explore our sample applications and templates
6464
Authorization).
6565

6666
`NEXT.JS` `LLAMAINDEX`
67+
6768
</Card>
6869
<Card href="https://github.com/auth0-samples/auth0-ai-samples" title="AI Samples" vertical>
6970
Explore our repository of standalone sample applications that showcase

auth4genai/intro/token-vault.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ You can securely access external APIs on the user's behalf using Auth0's **Token
1414

1515
<Frame>
1616
<iframe
17-
width="590px"
18-
height="330px"
1917
src="https://play.vidyard.com/9A42zhQBXirXUpb43PKKAZ.html"
2018
title="Calling APIs with Token Vault"
2119
frameborder="0"
2220
allow="accelerometer; autoplay; gyroscope; picture-in-picture; fullscreen"
2321
referrerpolicy="no-referrer-when-downgrade"
2422
allowfullscreen
23+
className="aspect-video object-cover w-full h-full"
2524
/>
2625
</Frame>
2726

@@ -31,8 +30,6 @@ Auth0's Token Vault is a secure service for storing and managing tokens for thir
3130

3231
Token Vault is built on top of [OAuth 2.0 Token Exchange (RFC 8693)](https://www.rfc-editor.org/rfc/rfc8693.html) and supports social and enterprise connections to other Identity Providers (IdPs). There is no need to manage refresh tokens or build custom integrations per provider because Auth0 handles it all for you. You gain access to a wide range of external providers' APIs and services, all through a single Auth0 integration.
3332

34-
35-
3633
### Why Is Calling APIs with Token Vault Important for AI agents
3734

3835
Hardcoding API keys or asking users to constantly re-authenticate with these external services is insecure and provides a poor user experience. Token Vault solves this by providing a secure mechanism to store and use the user's credentials (in the form of tokens) for these services.
@@ -69,7 +66,8 @@ Token Vault supports a variety of social and enterprise identity providers, incl
6966
title="View All Integrations"
7067
href="/integrations/overview"
7168
icon="share-nodes"
72-
horizontal />
69+
horizontal
70+
/>
7371

7472
## Using Token Vault
7573

auth4genai/intro/user-authentication.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ sidebarTitle: Secure User Log In
66

77
<Frame>
88
<iframe
9-
width="590px"
10-
height="330px"
119
src="https://play.vidyard.com/cdwosENc4TT1ZhFdJmfKvF.html"
1210
title="User authentication for AI agents using Auth0"
1311
frameborder="0"
1412
allow="accelerometer; autoplay; gyroscope; picture-in-picture; fullscreen"
1513
referrerpolicy="no-referrer-when-downgrade"
1614
allowfullscreen
15+
className="aspect-video object-cover w-full h-full"
1716
/>
1817
</Frame>
1918

auth4genai/snippets/custom-grid/SearchAndFilterGrid.jsx

Lines changed: 82 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,40 @@
1-
import { useState, useMemo } from "react";
1+
import { useState, useMemo, useRef, useEffect } from "react";
22
import { CustomCard } from "/snippets/custom-grid/CustomCard.jsx";
33

44
export const SearchAndFilterGrid = ({ items = [], filters = [] }) => {
5-
65
const fuzzySearch = (needle, haystack) => {
76
if (!needle || !haystack) return false;
87
const needleLower = needle.toLowerCase();
98
const haystackLower = haystack.toLowerCase();
109
return haystackLower.includes(needleLower);
11-
}
10+
};
1211

1312
const [searchTerm, setSearchTerm] = useState("");
1413
const [filter, setFilter] = useState(null);
14+
const filterButtonsRef = useRef(null);
15+
const indicatorRef = useRef(null);
16+
17+
useEffect(() => {
18+
if (!filterButtonsRef.current || !indicatorRef.current) return;
19+
20+
const activeButton = filterButtonsRef.current.querySelector(
21+
".custom-grid-filter-button.active"
22+
);
23+
const container = filterButtonsRef.current;
24+
const indicator = indicatorRef.current;
25+
26+
if (activeButton) {
27+
const containerRect = container.getBoundingClientRect();
28+
const buttonRect = activeButton.getBoundingClientRect();
29+
30+
const left = buttonRect.left - containerRect.left - 2;
31+
const width = buttonRect.width;
32+
33+
indicator.style.transform = `translateX(${left}px)`;
34+
indicator.style.width = `${width}px`;
35+
indicator.style.opacity = "1";
36+
}
37+
}, [filter]);
1538

1639
const filteredItems = useMemo(() => {
1740
let filtered = items;
@@ -28,7 +51,7 @@ export const SearchAndFilterGrid = ({ items = [], filters = [] }) => {
2851
if (filter) {
2952
filtered = filtered.filter((item) => item.type === filter);
3053
}
31-
54+
3255
return filtered;
3356
}, [searchTerm, filter]);
3457

@@ -59,42 +82,76 @@ export const SearchAndFilterGrid = ({ items = [], filters = [] }) => {
5982
fill="none"
6083
className="custom-grid-search-icon"
6184
>
62-
<circle cx="11" cy="11" r="8" stroke="currentColor" strokeWidth="2"/>
63-
<path d="m21 21-4.35-4.35" stroke="currentColor" strokeWidth="2"/>
85+
<circle
86+
cx="11"
87+
cy="11"
88+
r="8"
89+
stroke="currentColor"
90+
strokeWidth="2"
91+
/>
92+
<path
93+
d="m21 21-4.35-4.35"
94+
stroke="currentColor"
95+
strokeWidth="2"
96+
/>
6497
</svg>
6598
</div>
66-
<div className="custom-grid-filter-buttons">
67-
<button
68-
onClick={() => setFilter(null)}
69-
className={`custom-grid-filter-button ${filter === null ? 'active' : ''}`}
70-
>
71-
All
72-
</button>
73-
{filters.map((filterOption) => (
99+
<div className="custom-grid-filter-buttons-wrapper">
100+
<div className="custom-grid-filter-buttons" ref={filterButtonsRef}>
74101
<button
75-
key={filterOption}
76-
onClick={() => setFilter(filterOption)}
77-
className={`custom-grid-filter-button ${filter === filterOption ? 'active' : ''}`}
102+
onClick={() => setFilter(null)}
103+
className={`custom-grid-filter-button ${
104+
filter === null ? "active" : ""
105+
}`}
78106
>
79-
{filterOption}
107+
All
80108
</button>
81-
))}
109+
{filters.map((filterOption) => (
110+
<button
111+
key={filterOption}
112+
onClick={() => setFilter(filterOption)}
113+
className={`custom-grid-filter-button ${
114+
filter === filterOption ? "active" : ""
115+
}`}
116+
>
117+
{filterOption}
118+
</button>
119+
))}
120+
<span
121+
ref={indicatorRef}
122+
className="custom-grid-filter-buttons-indicator"
123+
/>
124+
</div>
82125
</div>
83126
</div>
84127
</div>
85128

86-
<Columns cols={3}>
129+
<Columns cols={2}>
87130
{sortedItems.map((item) => (
88131
<CustomCard item={item} key={item.id} />
89132
))}
90133
</Columns>
91134

92135
{sortedItems.length === 0 && (
93136
<div className="custom-grid-no-results">
94-
<div className="custom-grid-no-results-icon">🔍</div>
95-
<h3 className="custom-grid-no-results-title">
96-
No results found
97-
</h3>
137+
<div className="custom-grid-no-results-icon">
138+
<svg
139+
width="40"
140+
height="40"
141+
viewBox="0 0 24 24"
142+
fill="none"
143+
xmlns="http://www.w3.org/2000/svg"
144+
class="sc-cpUzJl"
145+
>
146+
<path
147+
fill-rule="evenodd"
148+
clip-rule="evenodd"
149+
d="M10 2a8 8 0 104.87 14.348l5.423 5.423 1.414-1.415-5.415-5.415A8 8 0 0010 2zm-6 8a6 6 0 1112 0 6 6 0 01-12 0z"
150+
fill="currentColor"
151+
></path>
152+
</svg>
153+
</div>
154+
<h3 className="custom-grid-no-results-title">No results found</h3>
98155
<p className="custom-grid-no-results-text">
99156
{searchTerm ? `No results for "${searchTerm}". ` : ""}Try adjusting
100157
your search or filter criteria.
@@ -103,4 +160,4 @@ export const SearchAndFilterGrid = ({ items = [], filters = [] }) => {
103160
)}
104161
</div>
105162
);
106-
};
163+
};

0 commit comments

Comments
 (0)