title: Typescript error: Property 'status' does not exist on type 'never'.ts(2339)
body: <p>I've currently got a method that looks like this, which uses <code>nextjs/auth</code> to signin with credentials from a form. However, I'm getting a type checking error <code>Object is possibly 'undefined'.ts(2532)</code></p>
  <pre><code>const doStuff = async (values: any) =&gt; {
      const result: SignInOptions | undefined = await signIn('credentials', {
        redirect: false,
        password: values.pass,
        email: values.email,
      });
      if (result.status === 200 &amp;&amp; result.ok) {
        await asyncDispatcher(
          loginUser({
            email: values.email,
            password: values.pass,
          }),
        );
        router.push(props.redirectLocation);
      }
    };
  </code></pre>
  <p>I (sortof) understand why, if result == undefined then result.status could potentially be undefined and hey ho ERROR. Fine. So then I try this:</p>
  <pre><code>const doStuff = async (values: any) =&gt; {
      const result: SignInOptions | undefined = await signIn('credentials', {
        redirect: false,
        password: values.pass,
        email: values.email,
      });
      if (result &amp;&amp; result.status === 200 &amp;&amp; result.ok) {
        await asyncDispatcher(
          loginUser({
            email: values.email,
            password: values.pass,
          }),
        );
        router.push(props.redirectLocation);
      }
    };
  </code></pre>
  <p>I then get <code>Property 'status' does not exist on type 'never'.ts(2339)</code>  so then I try to implicitly check for the keys <code>if (result &amp;&amp; 'status' in result &amp;&amp; result.status === 200 &amp;&amp; result.ok) {</code> but this doesn't work either. Anyone know what I'm doing wrong here to get Typescript to play nice?</p>
  <p>Under the hood, the definition of signIn (from third party next-auth.js looks like this btw:</p>
  <pre><code>export declare function signIn&lt;P extends RedirectableProviderType | undefined = undefined&gt;(provider?: LiteralUnion&lt;BuiltInProviderType&gt;, options?: SignInOptions, authorizationParams?: SignInAuthorisationParams): Promise&lt;P extends RedirectableProviderType ? SignInResponse | undefined : undefined&gt;;
  </code></pre>
  <p>Update for Googlers.</p>
  <p>Wrong Response Type - SignInResponse not SignInOptions</p>
  <p>Solution:</p>
  <pre><code>const result: SignInResponse | undefined = await signIn&lt;'credentials'&gt;('credentials', {
        redirect: false,
        password: values.pass,
        email: values.email,
      });
      if (result &amp;&amp; 'status' in result &amp;&amp; result.status === 200 &amp;&amp; result.ok) {
  </code></pre>