logic function implementation for signin, signup, logout