Skip to content
Snippets Groups Projects
Commit 03ff33fd authored by Richard Fernando Heise Ferreira's avatar Richard Fernando Heise Ferreira
Browse files

govbr

parent ebddf302
No related branches found
No related tags found
No related merge requests found
Pipeline #38596 passed
"use client"
import mecredApi from "@/axiosConfig";
import { useSearchParams } from "next/navigation";
import { useEffect } from "react";
export default function Govbr() {
const searchParams = useSearchParams();
const state = searchParams.get("state");
const prev_state = localStorage.getItem("govbr_state", state);
const validate = async () => {
try {
const res = await mecredApi.post("/govbr");
} catch(error) {
console.error(error);
}
}
useEffect(() => {
const validateState = () => {
if (!prev_state || !state) {
console.error("State não encontrado!\nprev_state: ", prev_state, "\nstate: ", state);
}
if (prev_state !== state) {
console.error("States diferentes! Abortando.\nprev_state: ", prev_state, "\nstate: ", state);
}
}
validateState()
}, [searchParams, prev_state, state]);
};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment