@@ -4,13 +4,31 @@ import { AccountForm } from "../../../components/SettingsAccountForm/SettingsAcc
4
4
import { useAuth } from "components/AuthProvider/AuthProvider"
5
5
import { useMe } from "hooks/useMe"
6
6
import { usePermissions } from "hooks/usePermissions"
7
+ import { SignInForm } from "components/SignInForm/SignInForm"
8
+ import { retrieveRedirect } from "utils/redirect"
9
+ import { useQuery } from "@tanstack/react-query"
10
+ import { getAuthMethods } from "api/api"
7
11
8
12
export const AccountPage : FC = ( ) => {
13
+ const queryKey = [ "get-auth-methods" ]
14
+ const {
15
+ data : authMethodsData ,
16
+ error : authMethodsError ,
17
+ isLoading : authMethodsLoading ,
18
+ isFetched : authMethodsFetched ,
19
+ } = useQuery ( {
20
+ queryKey,
21
+ queryFn : getAuthMethods ,
22
+ } )
23
+
9
24
const [ authState , authSend ] = useAuth ( )
10
25
const me = useMe ( )
11
26
const permissions = usePermissions ( )
12
27
const { updateProfileError } = authState . context
13
28
const canEditUsers = permissions && permissions . updateUsers
29
+ // Extra
30
+ const redirectTo = retrieveRedirect ( location . search )
31
+ console . log ( authState . context . data )
14
32
15
33
return (
16
34
< Section title = "Account" description = "Update your account info" >
@@ -29,6 +47,17 @@ export const AccountPage: FC = () => {
29
47
} )
30
48
} }
31
49
/>
50
+
51
+ < SignInForm
52
+ authMethods = { authMethodsData }
53
+ redirectTo = { redirectTo }
54
+ isSigningIn = { false }
55
+ error = { authMethodsError }
56
+ onSubmit = { ( credentials : { email : string ; password : string } ) => {
57
+ console . log ( credentials )
58
+ return
59
+ } }
60
+ > </ SignInForm >
32
61
</ Section >
33
62
)
34
63
}
0 commit comments