added login conditions to devise and other links