files/en-us/web/api/navigatorlogin/setstatus/index.md
{{securecontext_header}}{{APIRef("FedCM API")}}
The setStatus() method of the {{domxref("NavigatorLogin")}} interface sets the login status of a federated identity provider (IdP), when called from the IdP's origin. By this, we mean "whether any users are logged into the IdP on the current browser or not". This should be called by the IdP site following a user login or logout.
The browser stores this state for each IdP; the FedCM API then uses it to reduce the number of requests it makes to the IdP (because it does not need to waste time requesting accounts when there are no users logged in to the IdP). It also mitigates potential timing attacks.
See Update login status using the Login Status API for more information about FedCM login status.
setStatus(status)
status
"logged-in": The IdP has at least one user account signed in."logged-out": All IdP user accounts are currently signed out.A {{jsxref("Promise")}} that fulfills with undefined.
SecurityError {{domxref("DOMException")}}
<iframe> nested one or more levels deep inside the first <iframe>, all levels of the nesting hierarchy must be same-origin for the call to be successful./* Set logged-in status */
navigator.login.setStatus("logged-in");
/* Set logged-out status */
navigator.login.setStatus("logged-out");
{{Specifications}}
{{Compat}}