mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 21:51:56 +00:00
Begin Netlify integration
This commit is contained in:
@@ -7,6 +7,8 @@ import AuthorizeIntegration from "./api/integrations/authorizeIntegration";
|
||||
export default function Netlify() {
|
||||
const router = useRouter();
|
||||
const parsedUrl = queryString.parse(router.asPath.split("?")[1]);
|
||||
const code = parsedUrl.code;
|
||||
const state = parsedUrl.state;
|
||||
// modify comment here
|
||||
|
||||
/**
|
||||
@@ -14,16 +16,19 @@ export default function Netlify() {
|
||||
*/
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
useEffect(async () => {
|
||||
console.log('AA');
|
||||
if (state === localStorage.getItem('latestCSRFToken')) {
|
||||
localStorage.removeItem('latestCSRFToken');
|
||||
|
||||
console.log('Netlify', parsedUrl);
|
||||
// http://localhost:8080/netlify?code=qnG0g_krhklWDpdUqfhU-t1sLeZzYI3gF2d6QVnL-Gc&state=3a78cd3154a9a99ddd4eb5d99dbb3289
|
||||
// http://localhost:8080/netlify#access_token=d-78qUAnnSzvlgfG9Y_oUV6_4TQBxLbofImiBbKAjzE&token_type=Bearer&state=5da34fa49e301e9fa1a6e40925694b77
|
||||
|
||||
// await AuthorizeIntegration({
|
||||
// workspaceId: localStorage.getItem('projectData.id'),
|
||||
// code,
|
||||
// integration: "vercel"
|
||||
// });
|
||||
await AuthorizeIntegration({
|
||||
workspaceId: localStorage.getItem('projectData.id'),
|
||||
code,
|
||||
integration: "netlify"
|
||||
});
|
||||
|
||||
// router.push("/integrations/" + localStorage.getItem("projectData.id"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user