mirror of
https://github.com/makeplane/plane.git
synced 2026-07-12 21:40:18 +02:00
* chore: ff oidc saml init * chore: admin feature flag endpoint * [WEB-2413] chore: feature flag for admin app and OIDC SAML Auth validation. --------- Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
14 lines
516 B
TypeScript
14 lines
516 B
TypeScript
import { useContext } from "react";
|
|
// context
|
|
import { StoreContext } from "@/lib/store-provider";
|
|
|
|
export enum E_FEATURE_FLAGS {
|
|
OIDC_SAML_AUTH = "OIDC_SAML_AUTH",
|
|
}
|
|
|
|
export const useInstanceFlag = (flag: keyof typeof E_FEATURE_FLAGS, defaultValue: boolean = false): boolean => {
|
|
const context = useContext(StoreContext);
|
|
if (context === undefined) throw new Error("useInstanceFlag must be used within StoreProvider");
|
|
return context.instanceFeatureFlags.flags?.[E_FEATURE_FLAGS[flag]] ?? defaultValue;
|
|
};
|