Skip to content

Commit

Permalink
[#161] ๐Ÿ› react-google-logout ๊ตฌ๊ธ€ ๋กœ๊ทธ์•„์›ƒ ์‹คํŒจ ์‹œ์—๋„ ์ฟ ํ‚ค๋Š” ๋งŒ๋ฃŒ์ฒ˜๋ฆฌ๋˜๋„๋ก ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
inhyuck committed Aug 28, 2021
1 parent 5733862 commit efd0170
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hooks/useLogout.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {useGoogleLogout} from 'react-google-login'
import {GOOGLE} from '$config'
import {withAxios} from '$utils/fetcher/withAxios'
import {noop} from '$utils/index'

const useLogout = (isGoogleLogin: boolean) => {
const requestLogout = async () => {
Expand All @@ -11,7 +12,7 @@ const useLogout = (isGoogleLogin: boolean) => {

const {signOut} = useGoogleLogout({
clientId: GOOGLE.CLIENT_ID,
onLogoutSuccess: requestLogout,
onLogoutSuccess: noop,
onFailure: () => {
console.error('๊ตฌ๊ธ€ ๊ณ„์ • ๋กœ๊ทธ์•„์›ƒ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.')
},
Expand All @@ -20,8 +21,8 @@ const useLogout = (isGoogleLogin: boolean) => {
return () => {
if (isGoogleLogin) {
signOut()
return
}

requestLogout()
}
}
Expand Down

0 comments on commit efd0170

Please sign in to comment.