User Settings
Authgear provides a wide range of prebuilt frontend for the authentication related features of your apps

Open the settings page with the SDK

When the end-user has signed in, the SDK provides a method to open the settings page in a webview.
React Native
iOS
Android
1
import React, { useCallback } from "react";
2
import authgear, { Page } from "@authgear/react-native";
3
import { View, Button } from "react-native";
4
5
function SettingsScreen() {
6
const onPressOpenSettingsPage = useCallback(() => {
7
authgear.open(Page.Settings).then(() => {
8
// When the promise resolves, the webview have been closed.
9
});
10
}, []);
11
return (
12
<View>
13
<Button
14
title="Open Settings Page"
15
onPress={onPressOpenSettingsPage}
16
/>
17
</View>
18
);
19
}
Copied!
1
func onPressOpenSettingsPage(sender: UIButton, forEvent event: UIEvent) {
2
authgear.open(.settings) {
3
// When the completion handler is called, the webview is closed.
4
}
5
}
Copied!
1
public void onClickOpenSettingsPage() {
2
authgear.open(Page.Settings, null, new OnOpenURLListener() {
3
@Override
4
public void onClosed() {
5
// The webview is closed.
6
}
7
8
@Override
9
public void onFailed(Throwable throwable) {
10
// Some error occured.
11
}
12
});
13
}
Copied!

Open the settings page directly

In case your application is a website, the web SDK does not provide a method to open the settings page. However, you can construct the URL to the settings page as follows:
https://<your-app-endpoint>/settings
And then you can just set this as the href of your anchor tag
Web
1
function SettingsScreen() {
2
return (
3
<div>
4
<a href={SETTINGS_PAGE_URL}>Open Settings Page</a>
5
</div>
6
);
7
}
Copied!

Actions in the settings page

The end-user can perform the following actions on the setting page:
    Change their password.
    Add or change their email, phone number or username.
    Connect or disconnect to identity providers.
    Manage the signed in sessions.
    Enable or disable 2-step verification.
    and many more.
Last modified 1mo ago