Redirect after login

This commit is contained in:
Robert Long
2021-08-09 18:38:19 -07:00
parent 6d39f8bae0
commit 0bd8800402
3 changed files with 69 additions and 20 deletions

View File

@@ -63,7 +63,7 @@ export function useConferenceCallManager(homeserverUrl) {
});
}, []);
const login = useCallback(async (username, password) => {
const login = useCallback(async (username, password, cb) => {
setState((prevState) => ({
...prevState,
authenticated: false,
@@ -78,6 +78,10 @@ export function useConferenceCallManager(homeserverUrl) {
authenticated: true,
error: undefined,
});
if (cb) {
cb();
}
})
.catch((err) => {
console.error(err);
@@ -91,7 +95,7 @@ export function useConferenceCallManager(homeserverUrl) {
});
}, []);
const register = useCallback(async (username, password) => {
const register = useCallback(async (username, password, cb) => {
setState((prevState) => ({
...prevState,
authenticated: false,
@@ -106,6 +110,10 @@ export function useConferenceCallManager(homeserverUrl) {
authenticated: true,
error: undefined,
});
if (cb) {
cb();
}
})
.catch((err) => {
console.error(err);