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
36 changes: 18 additions & 18 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"eslint": "^9.39.5",
"jest": "^30.5.2",
"pino-pretty": "^13.1.3",
"prettier": "^3.9.9",
"prettier": "^3.9.10",
"prisma": "^7.10.1",
"source-map-support": "^0.5.21",
"ts-jest": "^29.4.15",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@types/react-dom": "^19.3.0",
"autoprefixer": "^10.6.1",
"eslint": "^9.39.5",
"eslint-config-next": "^16.3.8",
"eslint-config-next": "^16.4.0",
"postcss": "^8.5.28",
"tailwindcss": "^4.0.0",
"typescript": "^5.9.3"
Expand Down
14 changes: 7 additions & 7 deletions packages/frontend/src/app/connectors/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ export default function ConnectorDetailPage() {
>([]);
const [savingEnvVars, setSavingEnvVars] = useState(false);

const resetOauth1Fields = () => {
setEditOauth1Key('');
setEditOauth1Secret('');
setEditOauth1Token('');
setEditOauth1TokenSecret('');
};

const fetchConnector = async () => {
if (!token) return;
try {
Expand Down Expand Up @@ -404,13 +411,6 @@ export default function ConnectorDetailPage() {
fetchConnector();
}, [token, id]);

const resetOauth1Fields = () => {
setEditOauth1Key('');
setEditOauth1Secret('');
setEditOauth1Token('');
setEditOauth1TokenSecret('');
};

const buildAuthConfig = () => {
// Only send authConfig if the user filled in credential fields;
// empty fields mean "keep existing credentials on the server".
Expand Down
14 changes: 7 additions & 7 deletions packages/frontend/src/app/settings/identity-providers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ const emptyForm = (): IdentityProviderInput & { config: Record<string, string> }
roleSyncDefaultRoleIds: [],
});

// True when the client secret runs out within 30 days.
function expiringSoon(p: IdentityProvider): boolean {
if (!p.clientSecretExpiresAt) return false;
const days = (new Date(p.clientSecretExpiresAt).getTime() - Date.now()) / 86_400_000;
return days < 30;
}

export default function IdentityProvidersPage() {
const { token, user: currentUser, deploymentMode, deploymentModeLoaded } = useAuth();
const toast = useToast();
Expand Down Expand Up @@ -370,13 +377,6 @@ export default function IdentityProvidersPage() {
`${typeof window === 'undefined' ? '' : window.location.origin}/sso/${p.initiateId}`;

const spec = PROVIDER_TYPES[form.type];
const expiringSoon = (p: IdentityProvider) => {
if (!p.clientSecretExpiresAt) return false;
const days =
(new Date(p.clientSecretExpiresAt).getTime() - Date.now()) / 86_400_000;
return days < 30;
};

return (
<div className="space-y-6">
{locked && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import { Button } from '@/components/ui/button';
import { Badge } from '@/components/ui/badge';
import { useToast } from '@/components/toast';

// True when the identity provider has not called in for over two hours.
function isStale(lastRequestAt: string): boolean {
return Date.now() - new Date(lastRequestAt).getTime() > 2 * 3600_000;
}

/**
* Provisioning (SCIM) for one provider.
*
Expand Down Expand Up @@ -124,10 +129,7 @@ export function ScimPanel({
const labelClass = 'block text-[11.5px] font-medium text-[var(--text-3)] mb-1';
const codeClass =
'text-[11.5px] text-[var(--text-2)] bg-[var(--surface-2)] rounded px-1.5 py-0.5 break-all';
const stale =
status?.enabled && status.lastRequestAt
? Date.now() - new Date(status.lastRequestAt).getTime() > 2 * 3600_000
: false;
const stale = status?.enabled && status.lastRequestAt ? isStale(status.lastRequestAt) : false;

return (
<div className="mt-3 pt-3 border-t border-[var(--border)] space-y-3">
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/app/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default function SettingsPage() {
const { authorizationUrl } = await sso.startLink(p.id, '/settings', token);
// Top-level navigation, not fetch: the provider needs to render its own
// sign-in page to the user.
window.location.href = authorizationUrl;
window.location.assign(authorizationUrl);
} catch (err: any) {
toast.show({ tone: 'error', title: 'Could not connect', description: err.message });
setLinkBusy(null);
Expand Down
Loading