File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
src/ui/layouts/session/Login Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff 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 ( ) ;
Original file line number Diff line number Diff line change 1- import { useState } from 'react' ;
1+ import { useEffect , useState } from 'react' ;
22import { DEFAULT_WORKSPACE_NAME , toasterTypes } from '../../../../constants' ;
33import {
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 ) ;
You can’t perform that action at this time.
0 commit comments