Customize Login Page with Script

I want to have the website login page, if the user is already logged in, automatically redirect them to the desk instead of giving the option to re-login. How would I achieve this?

See commit f6073cf

where could I found this ?

This link should help: