Fix SSO check - change the order of the PKCE and device auth flow check, prefer PKCE - fix error handling in PKCE check