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

testando code

parent ff9b9a96
No related branches found
No related tags found
No related merge requests found
Pipeline #38658 passed
......@@ -16,24 +16,36 @@ export default function Govbr() {
}
useEffect(() => {
let code;
const validateState = () => {
if (!localStorage.getItem("govbr_state", state)) {
if (!searchParams.get("govbr_code")) {
console.error("local storage não possui code.")
return
}
code = searchParams.getItem("govbr_code");
console.log(code)
if (!localStorage.getItem("govbr_state")) {
console.error("local storage não possui state anterior.")
return
}
const prev_state = localStorage.getItem("govbr_state", state);
const prev_state = localStorage.getItem("govbr_state");
if (!searchParams.get("state")) {
console.error("Não existe state na URL.")
return
}
const state = searchParams.get("state");
if (!prev_state || !state) {
console.error("State não encontrado!\nprev_state: ", prev_state, "\nstate: ", state);
return
}
if (prev_state !== state) {
console.error("States diferentes! Abortando.\nprev_state: ", prev_state, "\nstate: ", state);
return
}
console.log("State validado com sucesso!")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment