Login based on template