Redirect user back to login page with error message displayed

I was wondering if anyone could help me with this? Or provide an update?