kossiitkgp / KWoC-Frontend

Frontend Repo for Kharagpur Winter of Code, built in React
https://kwoc.kossiitkgp.org/
GNU General Public License v3.0
21 stars 44 forks source link

test things by changing redirect uri #37

Closed github-actions[bot] closed 2 years ago

github-actions[bot] commented 3 years ago

test things by changing redirect uri

https://github.com/kossiitkgp/KWoC-21-Frontend/blob/121a45e5adf55fb809955519722d0880043140cb/src/components/OAuth.js#L14


import React, { useEffect } from "react";
import { useAuth } from "../hooks/Auth";

function OAuth() {
  let auth = useAuth();

  useEffect(() => {
    const params = new URLSearchParams(window.location.search);
    const data = {
      code: params.get("code"),
      state: params.get("state"),
    };

    // TODO: test things by changing redirect uri
    auth.login(
      data,
      () => {
        // TODO: use react-hot-toast for login, announcement etc. notifs
        console.log("succex");
      },
      (e) => {
        console.log(e);
        alert("Server Error! Please try again");
      }
    );

    // DOUBT(@rakaar): what is the need for this?
    // if (!res["isNewUser"]) props.history.push("/dashboard/mentor");
  }, []);

  return (

4ec0981b150aedd9151533fda9dd33cf6af60144

github-actions[bot] commented 2 years ago

Closed in 7bcf85e63707cbd14119289ebc36e2e3e7e6cedc