Implement Clerk as authentication backend (OAuth2).

This commit is contained in:
Orne Brocaar
2023-12-19 13:49:16 +00:00
parent f45d12519c
commit 9198d7d51b
30 changed files with 4430 additions and 1125 deletions

View File

@ -53,15 +53,20 @@ function Header({ user }: { user: User }) {
}
let oidc = settings.getOpenidConnect()!;
let oAuth2 = settings.getOauth2()!;
if (!oidc.getEnabled() || oidc.getLogoutUrl() === "") {
SessionStore.logout(true, () => {
navigate("/login");
});
} else {
if (oidc.getEnabled() && oidc.getLogoutUrl() !== "") {
SessionStore.logout(false, () => {
navigate(oidc.getLogoutUrl());
});
} else if (oAuth2.getEnabled() && oAuth2.getLogoutUrl() !== "") {
SessionStore.logout(false, () => {
navigate(oAuth2.getLogoutUrl());
});
} else {
SessionStore.logout(true, () => {
navigate("/login");
});
}
};
@ -86,23 +91,23 @@ function Header({ user }: { user: User }) {
label: any;
options: any[];
}[] = [
{
label: renderTitle("Tenants"),
options: [],
},
{
label: renderTitle("Gateways"),
options: [],
},
{
label: renderTitle("Applications"),
options: [],
},
{
label: renderTitle("Devices"),
options: [],
},
];
{
label: renderTitle("Tenants"),
options: [],
},
{
label: renderTitle("Gateways"),
options: [],
},
{
label: renderTitle("Applications"),
options: [],
},
{
label: renderTitle("Devices"),
options: [],
},
];
if (searchResult !== undefined) {
for (const res of searchResult.getResultList()) {