File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,11 +2,9 @@ import { useMutation } from '@tanstack/react-query'
22import { axios } from 'src/lib/axios'
33import { MutationConfig } from 'src/lib/react-query'
44
5- type Provider = 'google.com' | 'github.com'
6-
75export type GetOauthLinkDTO = {
86 data : {
9- provider : Provider
7+ provider : string
108 state : string
119 }
1210}
Original file line number Diff line number Diff line change @@ -25,16 +25,16 @@ export const AuthModal = ({ showAuth }: AuthModalProps) => {
2525
2626 const requestOauthLink = useCallback (
2727 async ( provider : AuthProvider ) => {
28- const getOauthLinkResponse = await getOauthLink . mutateAsync ( {
29- data : {
30- provider : provider . providerId as 'google.com' | 'github.com' ,
31- state : BUILD_TARGET === 'web' ? window . location . origin : getBrowserName ( ) ,
32- } ,
33- } )
34-
35- if ( getOauthLinkResponse . authLink ) {
36- window . open ( getOauthLinkResponse . authLink , BUILD_TARGET === 'web' ? '_self' : '_blank' )
37- }
28+ getOauthLink
29+ . mutateAsync ( {
30+ data : {
31+ provider : provider . providerId ,
32+ state : BUILD_TARGET === 'web' ? window . location . origin : getBrowserName ( ) ,
33+ } ,
34+ } )
35+ . then ( ( { authLink } ) => {
36+ window . open ( authLink , BUILD_TARGET === 'web' ? '_self' : '_blank' )
37+ } )
3838 } ,
3939 [ getOauthLink ]
4040 )
You can’t perform that action at this time.
0 commit comments