This question already has an answer here:

After authorization, https://data.stackexchange.com redirects to the main page.

Could you redirect to the original page (from which I've tried to log in)?

marked as duplicate by Suvitruf, Community Jun 8 at 10:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.