import React, { useState, ChangeEvent, FormEvent } from "react"; import { authApi } from "../apis"; import { catchErrors } from "../helpers"; export const SocialLogin = () => { const [error, setError] = useState(""); const [loading, setLoading] = useState(false); const [keyInfo, setKeyInfo] = useState({ socialType: "kakao", REST_API_KEY: "", REDIRECT_URI: "", CLIENT_SECRET_KEY: "", }); const handleSubmit = async (e: FormEvent) => { const { socialType, REST_API_KEY, REDIRECT_URI, CLIENT_SECRET_KEY } = keyInfo; try { setLoading(true); await authApi.saveOauthKeys( socialType, REST_API_KEY, REDIRECT_URI, CLIENT_SECRET_KEY ); } catch (error) { setLoading(false); catchErrors(error, setError); } }; const handleChange = (e: ChangeEvent) => { const { name, value } = e.currentTarget; setKeyInfo({ ...keyInfo, [name]: value }); }; return (
일단 카카오 로그인만 구현
); };