Send alerts in GetServerSideProps in whilst redirect?

I created a component that redirects users that are not logged in in getServerSideProps. I … Read more Send alerts in GetServerSideProps in whilst redirect?

I created a component that redirects users that are not logged in in getServerSideProps. I was wondering what I could do to display an alert on the page that the user is redirected to. I redirect users using

    try {
      const user = await Auth.currentAuthenticatedUser();
    } catch (err) {
      res.writeHead(302, {
        Location: "/contests/0/error",
      });
      res.end();
    }

Source: React – Stack Overflow


Categories: NewsTags: ,

Tags: ,


Leave a Reply

Your email address will not be published. Required fields are marked *