Move LoginProvider to component/sesyon & improve it
This commit is contained in:
@@ -3,10 +3,12 @@ import Link from 'next/link'
|
|||||||
import {signIn} from 'next-auth/client'
|
import {signIn} from 'next-auth/client'
|
||||||
import {Button} from '@material-ui/core'
|
import {Button} from '@material-ui/core'
|
||||||
|
|
||||||
export default function LoginProvider({id, title, icon}) {
|
export default function LoginProvider({id, title, icon, callbackUrl}) {
|
||||||
const hanleClick = event => {
|
const hanleClick = event => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
signIn(id)
|
signIn(id, {
|
||||||
|
callbackUrl
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -26,5 +28,6 @@ export default function LoginProvider({id, title, icon}) {
|
|||||||
LoginProvider.propTypes = {
|
LoginProvider.propTypes = {
|
||||||
id: PropTypes.string.isRequired,
|
id: PropTypes.string.isRequired,
|
||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.string.isRequired,
|
||||||
icon: PropTypes.node.isRequired
|
icon: PropTypes.node.isRequired,
|
||||||
|
callbackUrl: PropTypes.string.isRequired
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user