I'd handle this very close to the program entry point. If you look in your main function you'll probably see something like this:
Application.Run(new Form1());
You can create a loop here to do your stuff:
while (condition)
{
Application.Run(new LoginForm());
Application.Run(new MainForm());
}
but you'll need some extra logic for the authentication etc..