> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portalhq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# getMethods

> Returns the sign-in methods enabled for the auth environment and whether it expects your app to create a wallet after sign-in.

**Function Signature**

```swift theme={null}
public func getMethods() async throws -> AuthMethodsResult
```

A `PortalAuth` method. Idempotent and side-effect free, so it is safe to call on every sign-in screen and safe to retry.

**Returns**

* **`AuthMethodsResult`**: Contains the following:
  * **`allowedAuthMethods`**: `[AuthMethod]`, the enabled methods: `.emailMagicLink`, `.google`, `.apple`. Values this SDK version does not recognize are dropped, never surfaced.
  * **`autoCreateWallet`**: `Bool`, the environment's **Auto-create wallet** setting. A hint for your app; Portal never creates the wallet itself.

**Throws**

* `PortalAuthError.malformedResponse(path:missing:)`: The response did not carry the documented fields.
* `PortalRequestsError.unauthorized`: The Auth Environment ID does not match an environment, or authentication is switched off for it.
* Other transport errors unchanged.

**Notes**

* A two-factor requirement is not observable here. It only shows up as `.totpRequired` in the result of `handleRedirect` or `signInWith*`.
* A provider that is enabled but incompletely configured still appears in `allowedAuthMethods`, and makes `loginWith*` / `signInWith*` fail for every provider. See [`loginWithGoogle`](./portalauthloginwithgoogle).
* Call it again after adopting a session to decide whether to create a wallet; see [Create or reuse the wallet](../guide/client-auth#create-or-reuse-the-wallet).
* Available starting from SDK version 8.0.0.

**Example Usage**

```swift theme={null}
import PortalSwift

do {
    let methods = try await auth.getMethods()

    magicLinkForm.isHidden = !methods.allowedAuthMethods.contains(.emailMagicLink)
    googleButton.isHidden = !methods.allowedAuthMethods.contains(.google)
    appleButton.isHidden = !methods.allowedAuthMethods.contains(.apple)

    if methods.autoCreateWallet {
        print("Create a wallet after sign-in if the user has none.")
    }
} catch {
    print("Error fetching auth methods: \(error)")
}
```

**Related Documentation**

* [PortalAuth reference](./portalauth)
* [Client Auth](../guide/client-auth)
* [Enable authentication](../../../resources/authentication/enable-authentication)
