Client side Facebook login code with state.