Translations:Manual:$wgRedirectOnLogin/5/en

Setting this option to null will make the user be redirected back to the page they came from via the $returnto URL parameter.