Sign in with apple Button JS Response Check

Hi, I'm developing the "sign in with apple" button.

When I get the response from apple I can check the 'state' variable but what's the best way to know that the response actually comes from apple and not something else?