Skip to content

Commit d3820d3

Browse files
authored
Merge pull request #447 from zenml-io/UAT
hotfix
2 parents a7c1f66 + 3efc041 commit d3820d3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/ui/layouts/session/Login/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const Form: React.FC = () => {
2424
login();
2525
};
2626

27-
const BUTTON_DISABLED = username.trim() === '';
27+
const BUTTON_DISABLED = username?.trim() === '';
2828

2929
useEnterKeyPress(() => {
3030
if (!BUTTON_DISABLED) login();

src/ui/layouts/session/Login/useService.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState } from 'react';
1+
import { useEffect, useState } from 'react';
22
import { DEFAULT_WORKSPACE_NAME, toasterTypes } from '../../../../constants';
33
import {
44
workspacesActions,
@@ -33,6 +33,15 @@ export const useService = (): ServiceInterface => {
3333
const { push } = usePushRoute();
3434
const dispatch = useDispatch();
3535

36+
useEffect(() => {
37+
// Get the query parameters from the URL
38+
const searchParams = new URLSearchParams(window.location.search);
39+
40+
// Access individual query parameters
41+
setUsername(searchParams.get('username') as string);
42+
setPassword(searchParams.get('password') as string);
43+
}, []);
44+
3645
return {
3746
login: async () => {
3847
setLoading(true);

0 commit comments

Comments
 (0)