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
1 change: 1 addition & 0 deletions src/authsome/auth/input_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class InputField(BaseModel):
label: str
secret: bool = True
default: str | None = None
required: bool = True
#: Optional regex (``re.fullmatch``) that the submitted value must satisfy.
pattern: str | None = None
#: Optional human-readable message shown when the value does not match ``pattern``.
Expand Down
10 changes: 9 additions & 1 deletion src/authsome/auth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,15 @@ def required_inputs( # noqa: PLR0913
needs_scopes = flow_type in (FlowType.PKCE, FlowType.DEVICE_CODE, FlowType.DCR_PKCE)
if needs_scopes and scopes is None and persisted_scopes is None:
default_scopes = ",".join(provider.oauth.scopes) if provider.oauth and provider.oauth.scopes else ""
fields.append(InputField(name="scopes", label="Scopes (comma-separated)", secret=False, default=default_scopes))
fields.append(
InputField(
name="scopes",
label="Scopes (comma-separated)",
secret=False,
default=default_scopes,
required=False,
)
)

if flow_type == FlowType.API_KEY:
api_key_field = InputField(name="api_key", label="API Key", secret=True)
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/authsome-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<section className="mx-auto grid w-full max-w-6xl gap-10 lg:grid-cols-[0.9fr_1.1fr] lg:items-center">
<div className="max-w-md">
<div>
<img alt="Authsome" className="mb-8 size-11" src="/logo.svg" />

Check warning on line 173 in ui/src/components/authsome-dashboard.tsx

View workflow job for this annotation

GitHub Actions / lint

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
<h1 className="text-4xl font-semibold leading-tight text-foreground">
Authsome
</h1>
Expand Down Expand Up @@ -399,7 +399,7 @@
defaultValue={field.default || ""}
name={field.name}
pattern={field.pattern || undefined}
required
required={field.required !== false}
type={field.secret ? "password" : "text"}
/>
{field.pattern_hint ? (
Expand Down Expand Up @@ -558,7 +558,7 @@
<section className="mx-auto w-full max-w-md">
<Card className="border-border/70 shadow-none">
<CardHeader>
<img alt="Authsome" className="mb-4 size-9" src="/logo.svg" />

Check warning on line 561 in ui/src/components/authsome-dashboard.tsx

View workflow job for this annotation

GitHub Actions / lint

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
<CardTitle>{title}</CardTitle>
<CardDescription>{description}</CardDescription>
</CardHeader>
Expand Down Expand Up @@ -658,7 +658,7 @@
<aside className="flex border-r bg-sidebar md:min-h-screen md:w-64 md:flex-col">
<div className="hidden border-b px-5 py-4 md:block">
<div className="flex items-center gap-2">
<img alt="Authsome" className="size-7" src="/logo.svg" />

Check warning on line 661 in ui/src/components/authsome-dashboard.tsx

View workflow job for this annotation

GitHub Actions / lint

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
<span className="text-sm font-semibold">Authsome</span>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions ui/src/lib/authsome-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export type SessionInputField = {
label: string;
secret: boolean;
default?: string | null;
required?: boolean;
pattern?: string | null;
pattern_hint?: string | null;
};
Expand Down
Loading