Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticate Promise Return #155

Closed
maxmezzomo opened this issue Jan 18, 2022 · 1 comment
Closed

Authenticate Promise Return #155

maxmezzomo opened this issue Jan 18, 2022 · 1 comment

Comments

@maxmezzomo
Copy link

maxmezzomo commented Jan 18, 2022

New Feature Request

Checklist

Current Limitation

The React authenticate function returns a void promise authenticate: (options?: AuthenticateOptions) => Promise<void>;

Feature / Enhancement Description

It would be nice to have a response to handle. Either for errors or anything else. In the the docs at https://docs.moralis.io/moralis-server/users/crypto-login#metamask it appears that there should be some response in the JS SDK although looking through the types it seems void as well (moralis/types/index.d.ts).

Example Use Case

Any time you want to authenticate a user. Maybe catch errors.

Alternatives / Workarounds

I think its probably fine for most use cases to just use the authError from the context. It just will not allow catching the error. In terms of development philosophy I dont actually know if it matters or not that the error fall through to console. Its probably better I'm not sure about that.

@ErnoW
Copy link
Member

ErnoW commented Feb 9, 2022

Will be added in next version (#198)

Also, for error handling, you can specify throwOnError to handle the errors yourself. See https://github.com/MoralisWeb3/react-moralis#-error-handling

@ErnoW ErnoW closed this as completed Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants