-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
?
-
4481
-
Not Needed
-
SDK FY21-Q3.
Authentication in Realm is wrapped in nested namespaces, which makes the process not entirely straightforward. I believe we should rethink the way authentication is done and come up with a more ergonomic interface.
For example:
```jsx
// login
const creds = Realm.Credentials.emailPassword(email, password);
await app.logIn(creds);
// register
await app.emailPasswordAuth.registerUser(
);
```
In most cases, all required parameters for authentication are nested. Perhaps something like:
```jsx
import
from '@realm/auth'
emailPassword.login()
emailPassword.register()
```