@krak-stack/auth 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access.d.ts +1 -3
- package/dist/access.js +1 -3
- package/dist/admin/api.group.d.ts +36 -36
- package/dist/admin/api.group.js +13 -13
- package/dist/api.d.ts +2109 -865
- package/dist/auth/api.group.d.ts +664 -106
- package/dist/auth/api.group.js +8 -8
- package/dist/auth/schema.d.ts +537 -70
- package/dist/auth/schema.js +26 -10
- package/dist/components/admin-organization-form.js +1 -0
- package/dist/components/admin-organizations.d.ts +4 -5
- package/dist/components/admin-organizations.js +34 -31
- package/dist/components/admin-users.d.ts +5 -6
- package/dist/components/admin-users.js +51 -50
- package/dist/components/api-key-edit-form.js +2 -1
- package/dist/components/auth-atoms.d.ts +213 -103
- package/dist/components/auth-client-api.d.ts +1412 -2371
- package/dist/components/auth-client-api.js +11 -7
- package/dist/components/auth-forms.js +6 -1
- package/dist/components/auth-provider.d.ts +13 -13
- package/dist/components/contact-fields.d.ts +40 -0
- package/dist/components/contact-fields.js +86 -0
- package/dist/components/member-required.js +2 -2
- package/dist/components/organization-switcher.js +101 -193
- package/dist/components/user-button.d.ts +73 -0
- package/dist/components/user-button.js +179 -29
- package/dist/extra/api.group.d.ts +19 -19
- package/dist/extra/api.group.js +3 -3
- package/dist/extra/schema.d.ts +1 -2
- package/dist/extra/schema.js +1 -2
- package/dist/query.js +5 -5
- package/dist/schema.d.ts +279 -12
- package/dist/schema.js +162 -42
- package/dist/server/api.group.d.ts +157 -29
- package/dist/server/api.group.js +12 -12
- package/dist/server/schema.d.ts +64 -0
- package/dist/service.d.ts +3380 -2446
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { FetchHttpClient, HttpClient } from "effect/unstable/http";
|
|
3
3
|
import { AtomHttpApi } from "effect/unstable/reactivity";
|
|
4
|
-
import { HttpApiClient } from "effect/unstable/httpapi";
|
|
4
|
+
import { HttpApi, HttpApiClient } from "effect/unstable/httpapi";
|
|
5
5
|
import { AuthClientApi } from "../api.js";
|
|
6
6
|
import { defaultBaseUrl } from "../config.js";
|
|
7
7
|
const authClientApiUrl = (baseUrl) => {
|
|
@@ -15,12 +15,16 @@ export const authHttpClient = (baseUrl) => HttpApiClient.make(AuthClientApi, {
|
|
|
15
15
|
baseUrl: authClientApiUrl(baseUrl),
|
|
16
16
|
transformClient: withCredentials,
|
|
17
17
|
}).pipe(Effect.provide(FetchHttpClient.layer));
|
|
18
|
-
const createAuthClientApiClient = (key) =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const createAuthClientApiClient = (key) => {
|
|
19
|
+
class AuthClientApiClient extends AtomHttpApi.Service()(`AuthClientApi:${key}`, {
|
|
20
|
+
api: AuthClientApi,
|
|
21
|
+
baseUrl: key,
|
|
22
|
+
httpClient: FetchHttpClient.layer,
|
|
23
|
+
transformClient: withCredentials,
|
|
24
|
+
}) {
|
|
25
|
+
}
|
|
26
|
+
return AuthClientApiClient;
|
|
27
|
+
};
|
|
24
28
|
const authClientApis = new Map();
|
|
25
29
|
export const authClientApi = (baseUrl) => {
|
|
26
30
|
const key = authClientApiUrl(baseUrl);
|
|
@@ -258,6 +258,7 @@ export function Signin(props) {
|
|
|
258
258
|
return () => window.clearInterval(interval);
|
|
259
259
|
}, [emailOtpResendAvailableAt]);
|
|
260
260
|
const [form] = useState(() => FormReact.make(signinFormBuilder, {
|
|
261
|
+
runtime: authClientApi(baseUrl).runtime,
|
|
261
262
|
fields: { email: TextField, password: TextField, otp: OtpField },
|
|
262
263
|
mode: { validation: "onSubmit" },
|
|
263
264
|
onSubmit: (action, { decoded: value }) => Effect.gen(function* () {
|
|
@@ -340,7 +341,7 @@ export function Signin(props) {
|
|
|
340
341
|
}));
|
|
341
342
|
const submit = useAtomSet(form.submit);
|
|
342
343
|
const submitResult = useAtomValue(form.submit);
|
|
343
|
-
const [socialSignIn] = useState(() =>
|
|
344
|
+
const [socialSignIn] = useState(() => authClientApi(baseUrl).runtime.fn((provider) => Effect.gen(function* () {
|
|
344
345
|
const payload = oauthQuery
|
|
345
346
|
? {
|
|
346
347
|
provider,
|
|
@@ -441,6 +442,7 @@ export function VerifyEmail(props) {
|
|
|
441
442
|
const onNavigate = (target) => navigateTarget(target, navigate);
|
|
442
443
|
const [resent, setResent] = useState(false);
|
|
443
444
|
const [form] = useState(() => FormReact.make(verifyEmailFormBuilder, {
|
|
445
|
+
runtime: authClientApi(baseUrl).runtime,
|
|
444
446
|
fields: { email: TextField, otp: OtpField },
|
|
445
447
|
mode: { validation: "onSubmit" },
|
|
446
448
|
onSubmit: (action, { decoded: value }) => Effect.gen(function* () {
|
|
@@ -488,6 +490,7 @@ export function ForgotPassword(props) {
|
|
|
488
490
|
const initialEmail = getSearchParam(searchString, "email")?.trim() ?? "";
|
|
489
491
|
const [submitted, setSubmitted] = useState(false);
|
|
490
492
|
const [form] = useState(() => FormReact.make(forgotPasswordFormBuilder, {
|
|
493
|
+
runtime: authClientApi(baseUrl).runtime,
|
|
491
494
|
fields: { email: TextField },
|
|
492
495
|
mode: { validation: "onSubmit" },
|
|
493
496
|
onSubmit: (_, { decoded: value }) => Effect.gen(function* () {
|
|
@@ -521,6 +524,7 @@ function ResetPasswordForm({ token, ...props }) {
|
|
|
521
524
|
const navigate = useNavigate();
|
|
522
525
|
const onSuccess = () => navigate({ to: "/sign-in" });
|
|
523
526
|
const [form] = useState(() => FormReact.make(resetPasswordFormBuilder, {
|
|
527
|
+
runtime: authClientApi(baseUrl).runtime,
|
|
524
528
|
fields: { password: TextField },
|
|
525
529
|
mode: { validation: "onSubmit" },
|
|
526
530
|
onSubmit: (_, { decoded: value }) => Effect.gen(function* () {
|
|
@@ -554,6 +558,7 @@ export function TwoFactor(props) {
|
|
|
554
558
|
const [mode, setMode] = useState("totp");
|
|
555
559
|
const [emailCodeSent, setEmailCodeSent] = useState(false);
|
|
556
560
|
const [form] = useState(() => FormReact.make(twoFactorFormBuilder, {
|
|
561
|
+
runtime: authClientApi(baseUrl).runtime,
|
|
557
562
|
fields: { code: AuthCodeField, trustDevice: CheckboxField },
|
|
558
563
|
mode: { validation: "onSubmit" },
|
|
559
564
|
onSubmit: (action, { decoded: value }) => Effect.gen(function* () {
|
|
@@ -23,19 +23,19 @@ export type KrakstackAuthContextValue = {
|
|
|
23
23
|
export declare const listenForSessionRevalidation: (target: EventTarget, revalidate: () => void) => () => void;
|
|
24
24
|
export declare function KrakstackAuthProvider({ children, locale, baseUrl, projectId, access, accessLabels, }: KrakstackAuthProviderProps): import("react").JSX.Element;
|
|
25
25
|
export declare const useKrakstackAuth: () => KrakstackAuthContextValue | null;
|
|
26
|
-
export declare const useKrakstackAuthProjectConfig: () =>
|
|
27
|
-
readonly projectKey:
|
|
28
|
-
readonly name:
|
|
29
|
-
readonly logoUrl:
|
|
30
|
-
readonly authDomain:
|
|
31
|
-
readonly rootDomain:
|
|
32
|
-
readonly themeCss:
|
|
33
|
-
readonly authOptions:
|
|
34
|
-
readonly emailPassword:
|
|
35
|
-
readonly emailOtp:
|
|
36
|
-
readonly google:
|
|
37
|
-
}
|
|
38
|
-
}
|
|
26
|
+
export declare const useKrakstackAuthProjectConfig: () => {
|
|
27
|
+
readonly projectKey: string;
|
|
28
|
+
readonly name: string | null;
|
|
29
|
+
readonly logoUrl: string | null;
|
|
30
|
+
readonly authDomain: string | null;
|
|
31
|
+
readonly rootDomain: string | null;
|
|
32
|
+
readonly themeCss: string | null;
|
|
33
|
+
readonly authOptions: {
|
|
34
|
+
readonly emailPassword: boolean;
|
|
35
|
+
readonly emailOtp: boolean;
|
|
36
|
+
readonly google: boolean;
|
|
37
|
+
};
|
|
38
|
+
} | null;
|
|
39
39
|
export declare const usePermissions: () => {
|
|
40
40
|
loading: boolean;
|
|
41
41
|
permissions: Set<string>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FormReact } from "@lucas-barake/effect-form-react";
|
|
2
|
+
import type { ContactEmail, ContactLocale, ContactPhone, ContactSocial, ContactTranslation, ContactWebsite, OrganizationAddress } from "@krak-stack/auth/schema";
|
|
3
|
+
export type ContactFieldMessages = {
|
|
4
|
+
addEmail: string;
|
|
5
|
+
addPhone: string;
|
|
6
|
+
addSocial: string;
|
|
7
|
+
addWebsite: string;
|
|
8
|
+
email: string;
|
|
9
|
+
extension: string;
|
|
10
|
+
label: string;
|
|
11
|
+
phone: string;
|
|
12
|
+
platform: string;
|
|
13
|
+
remove: string;
|
|
14
|
+
url: string;
|
|
15
|
+
};
|
|
16
|
+
export type ContactAddressFieldMessages = ContactFieldMessages & {
|
|
17
|
+
addAddress: string;
|
|
18
|
+
country: string;
|
|
19
|
+
locality: string;
|
|
20
|
+
postalCode: string;
|
|
21
|
+
region: string;
|
|
22
|
+
street: string;
|
|
23
|
+
};
|
|
24
|
+
type ContactFieldProps = {
|
|
25
|
+
locale: ContactLocale;
|
|
26
|
+
maxItems?: number;
|
|
27
|
+
messages: ContactFieldMessages;
|
|
28
|
+
};
|
|
29
|
+
type ContactAddressFieldProps = {
|
|
30
|
+
locale: ContactLocale;
|
|
31
|
+
messages: ContactAddressFieldMessages;
|
|
32
|
+
};
|
|
33
|
+
export declare const contactTranslations: (translations: ReadonlyArray<ContactTranslation> | undefined, locale: ContactLocale, label: string) => ContactTranslation[];
|
|
34
|
+
export declare const contactLimitReached: (valueCount: number, maxItems?: number) => boolean;
|
|
35
|
+
export declare const ContactEmailsField: FormReact.FieldComponent<ReadonlyArray<ContactEmail>, ContactFieldProps>;
|
|
36
|
+
export declare const ContactPhonesField: FormReact.FieldComponent<ReadonlyArray<ContactPhone>, ContactFieldProps>;
|
|
37
|
+
export declare const ContactWebsitesField: FormReact.FieldComponent<ReadonlyArray<ContactWebsite>, ContactFieldProps>;
|
|
38
|
+
export declare const ContactSocialsField: FormReact.FieldComponent<ReadonlyArray<ContactSocial>, ContactFieldProps>;
|
|
39
|
+
export declare const ContactAddressesField: FormReact.FieldComponent<ReadonlyArray<OrganizationAddress>, ContactAddressFieldProps>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { FormReact } from "@lucas-barake/effect-form-react";
|
|
4
|
+
import { Option } from "effect";
|
|
5
|
+
import { Plus, Trash2 } from "lucide-react";
|
|
6
|
+
import { ErrorMessage } from "@krak-stack/registry/effect-form";
|
|
7
|
+
import { Button } from "@/components/ui/button";
|
|
8
|
+
import { Field, FieldLabel } from "@/components/ui/field";
|
|
9
|
+
import { Input } from "@/components/ui/input";
|
|
10
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select";
|
|
11
|
+
const socialPlatform = (value) => {
|
|
12
|
+
switch (value) {
|
|
13
|
+
case "facebook":
|
|
14
|
+
case "github":
|
|
15
|
+
case "instagram":
|
|
16
|
+
case "linkedin":
|
|
17
|
+
case "tiktok":
|
|
18
|
+
case "x":
|
|
19
|
+
case "youtube":
|
|
20
|
+
return value;
|
|
21
|
+
default:
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const contactLabel = (translations, locale) => translations?.find((translation) => translation.locale === locale)?.label ??
|
|
26
|
+
"";
|
|
27
|
+
export const contactTranslations = (translations, locale, label) => [
|
|
28
|
+
...(translations ?? []).filter((translation) => translation.locale !== locale && Boolean(translation.label.trim())),
|
|
29
|
+
...(label.trim() ? [{ locale, label }] : []),
|
|
30
|
+
];
|
|
31
|
+
export const contactLimitReached = (valueCount, maxItems) => maxItems !== undefined && valueCount >= maxItems;
|
|
32
|
+
const ContactInput = ({ className, id, label, onBlur, onChange, placeholder, type = "text", value, }) => (_jsxs("div", { className: className, children: [_jsx(FieldLabel, { htmlFor: id, children: label }), _jsx(Input, { id: id, className: "mt-2", value: value, type: type, placeholder: placeholder, onBlur: onBlur, onChange: (event) => onChange(event.target.value) })] }));
|
|
33
|
+
const ContactLabelInput = ({ id, locale, messages, onBlur, onChange, translations, }) => (_jsx(ContactInput, { id: id, label: messages.label, value: contactLabel(translations, locale), onBlur: onBlur, onChange: (label) => onChange(contactTranslations(translations, locale, label)) }));
|
|
34
|
+
const RepeatableContactField = ({ addLabel, emptyValue, error, maxItems, onChange, path, removeLabel, render, values, }) => (_jsx(Field, { children: _jsxs("div", { className: "flex flex-col gap-3", children: [values.map((value, index) => (_jsxs("div", { className: "bg-muted/20 relative rounded-lg border p-4 pr-12", children: [render(value, index, (next) => onChange(values.map((item, itemIndex) => itemIndex === index ? next : item))), _jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "absolute top-2 right-2", "aria-label": removeLabel, onClick: () => onChange(values.filter((_, itemIndex) => itemIndex !== index)), children: _jsx(Trash2, {}) })] }, `${path}-${index}`))), _jsxs(Button, { type: "button", variant: "outline", size: "sm", className: "self-start", "aria-label": addLabel, disabled: contactLimitReached(values.length, maxItems), onClick: () => onChange([...values, emptyValue]), children: [_jsx(Plus, {}), addLabel] }), error ? _jsx(ErrorMessage, { text: error }) : null] }) }));
|
|
35
|
+
const SocialPlatformSelect = ({ messages, value, onChange, }) => {
|
|
36
|
+
const items = [
|
|
37
|
+
{ label: "Facebook", value: "facebook" },
|
|
38
|
+
{ label: "GitHub", value: "github" },
|
|
39
|
+
{ label: "Instagram", value: "instagram" },
|
|
40
|
+
{ label: "LinkedIn", value: "linkedin" },
|
|
41
|
+
{ label: "TikTok", value: "tiktok" },
|
|
42
|
+
{ label: "X", value: "x" },
|
|
43
|
+
{ label: "YouTube", value: "youtube" },
|
|
44
|
+
];
|
|
45
|
+
return (_jsxs("div", { children: [_jsx(FieldLabel, { children: messages.platform }), _jsxs(Select, { items: items, value: value, onValueChange: (next) => {
|
|
46
|
+
const platform = socialPlatform(next);
|
|
47
|
+
if (platform)
|
|
48
|
+
onChange(platform);
|
|
49
|
+
}, children: [_jsx(SelectTrigger, { className: "mt-2 w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: items.map((item) => (_jsx(SelectItem, { value: item.value, children: item.label }, item.value))) })] })] }));
|
|
50
|
+
};
|
|
51
|
+
export const ContactEmailsField = ({ field, props }) => (_jsx(RepeatableContactField, { addLabel: props.messages.addEmail, emptyValue: {
|
|
52
|
+
email: "",
|
|
53
|
+
translations: [{ locale: props.locale, label: "" }],
|
|
54
|
+
}, error: Option.isSome(field.error) ? field.error.value : undefined, maxItems: props.maxItems, path: field.path, removeLabel: props.messages.remove, values: field.value, onChange: field.onChange, render: (contact, index, update) => (_jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsx(ContactInput, { id: `${field.path}-${index}-email`, label: props.messages.email, placeholder: "team@example.com", type: "email", value: contact.email, onBlur: field.onBlur, onChange: (email) => update({ ...contact, email }) }), _jsx(ContactLabelInput, { id: `${field.path}-${index}-label`, locale: props.locale, messages: props.messages, translations: contact.translations, onBlur: field.onBlur, onChange: (translations) => update({ ...contact, translations }) })] })) }));
|
|
55
|
+
export const ContactPhonesField = ({ field, props }) => (_jsx(RepeatableContactField, { addLabel: props.messages.addPhone, emptyValue: {
|
|
56
|
+
number: "",
|
|
57
|
+
translations: [{ locale: props.locale, label: "" }],
|
|
58
|
+
}, error: Option.isSome(field.error) ? field.error.value : undefined, maxItems: props.maxItems, path: field.path, removeLabel: props.messages.remove, values: field.value, onChange: field.onChange, render: (phone, index, update) => (_jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsx(ContactInput, { id: `${field.path}-${index}-number`, label: props.messages.phone, placeholder: "+1 514 555 0100", type: "tel", value: phone.number, onBlur: field.onBlur, onChange: (number) => update({ ...phone, number }) }), _jsx(ContactInput, { id: `${field.path}-${index}-extension`, label: props.messages.extension, value: phone.extension ?? "", onBlur: field.onBlur, onChange: (extension) => update({
|
|
59
|
+
...phone,
|
|
60
|
+
...(extension ? { extension } : { extension: undefined }),
|
|
61
|
+
}) }), _jsx(ContactLabelInput, { id: `${field.path}-${index}-label`, locale: props.locale, messages: props.messages, translations: phone.translations, onBlur: field.onBlur, onChange: (translations) => update({ ...phone, translations }) })] })) }));
|
|
62
|
+
export const ContactWebsitesField = ({ field, props }) => (_jsx(RepeatableContactField, { addLabel: props.messages.addWebsite, emptyValue: {
|
|
63
|
+
url: "",
|
|
64
|
+
translations: [{ locale: props.locale, label: "" }],
|
|
65
|
+
}, error: Option.isSome(field.error) ? field.error.value : undefined, maxItems: props.maxItems, path: field.path, removeLabel: props.messages.remove, values: field.value, onChange: field.onChange, render: (website, index, update) => (_jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsx(ContactInput, { id: `${field.path}-${index}-url`, label: props.messages.url, placeholder: "https://example.com", type: "url", value: website.url, onBlur: field.onBlur, onChange: (url) => update({ ...website, url }) }), _jsx(ContactLabelInput, { id: `${field.path}-${index}-label`, locale: props.locale, messages: props.messages, translations: website.translations, onBlur: field.onBlur, onChange: (translations) => update({ ...website, translations }) })] })) }));
|
|
66
|
+
export const ContactSocialsField = ({ field, props }) => (_jsx(RepeatableContactField, { addLabel: props.messages.addSocial, emptyValue: {
|
|
67
|
+
platform: "linkedin",
|
|
68
|
+
url: "",
|
|
69
|
+
translations: [{ locale: props.locale, label: "" }],
|
|
70
|
+
}, error: Option.isSome(field.error) ? field.error.value : undefined, maxItems: props.maxItems, path: field.path, removeLabel: props.messages.remove, values: field.value, onChange: field.onChange, render: (social, index, update) => (_jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsx(SocialPlatformSelect, { messages: props.messages, value: social.platform, onChange: (platform) => update({ ...social, platform }) }), _jsx(ContactInput, { id: `${field.path}-${index}-url`, label: props.messages.url, placeholder: "https://example.com/profile", type: "url", value: social.url, onBlur: field.onBlur, onChange: (url) => update({ ...social, url }) }), _jsx(ContactLabelInput, { id: `${field.path}-${index}-label`, locale: props.locale, messages: props.messages, translations: social.translations, onBlur: field.onBlur, onChange: (translations) => update({ ...social, translations }) })] })) }));
|
|
71
|
+
export const ContactAddressesField = ({ field, props }) => {
|
|
72
|
+
const inputs = [
|
|
73
|
+
{
|
|
74
|
+
key: "streetAddress",
|
|
75
|
+
label: props.messages.street,
|
|
76
|
+
className: "sm:col-span-2",
|
|
77
|
+
},
|
|
78
|
+
{ key: "locality", label: props.messages.locality },
|
|
79
|
+
{ key: "region", label: props.messages.region },
|
|
80
|
+
{ key: "postalCode", label: props.messages.postalCode },
|
|
81
|
+
{ key: "country", label: props.messages.country },
|
|
82
|
+
];
|
|
83
|
+
return (_jsx(RepeatableContactField, { addLabel: props.messages.addAddress, emptyValue: {
|
|
84
|
+
translations: [{ locale: props.locale, label: "" }],
|
|
85
|
+
}, error: Option.isSome(field.error) ? field.error.value : undefined, maxItems: undefined, path: field.path, removeLabel: props.messages.remove, values: field.value, onChange: field.onChange, render: (address, index, update) => (_jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [_jsx(ContactLabelInput, { id: `${field.path}-${index}-label`, locale: props.locale, messages: props.messages, translations: address.translations, onBlur: field.onBlur, onChange: (translations) => update({ ...address, translations }) }), inputs.map((input) => (_createElement(ContactInput, { ...(input.className ? { className: input.className } : {}), id: `${field.path}-${index}-${input.key}`, key: input.key, label: input.label, value: address[input.key] ?? "", onBlur: field.onBlur, onChange: (value) => update({ ...address, [input.key]: value }) })))] })) }));
|
|
86
|
+
};
|
|
@@ -60,7 +60,7 @@ const organizationDisplayName = (invitation, organization, fallback) => organiza
|
|
|
60
60
|
invitation?.organization?.name ??
|
|
61
61
|
invitation?.organizationName ??
|
|
62
62
|
fallback;
|
|
63
|
-
const acceptInvitationAtom = Atom.family((baseUrl) =>
|
|
63
|
+
const acceptInvitationAtom = Atom.family((baseUrl) => authClientApi(baseUrl).runtime.fn(({ invitationId, organizationId, onFailure, onSuccess, }, get) => Effect.gen(function* () {
|
|
64
64
|
const client = yield* authHttpClient(baseUrl);
|
|
65
65
|
yield* client.auth.organizationAcceptInvitation({
|
|
66
66
|
payload: { invitationId },
|
|
@@ -102,7 +102,7 @@ const accessAtom = Atom.family((baseUrl) => Atom.family((key) => {
|
|
|
102
102
|
userId: Schema.optional(Schema.String),
|
|
103
103
|
}));
|
|
104
104
|
const { locale, organizationId } = Schema.decodeUnknownSync(AccessKey)(key);
|
|
105
|
-
return Atom.keepAlive(
|
|
105
|
+
return Atom.keepAlive(authClientApi(baseUrl).runtime.atom((get) => Effect.gen(function* () {
|
|
106
106
|
const client = yield* authHttpClient(baseUrl);
|
|
107
107
|
const allowed = yield* client.auth
|
|
108
108
|
.organizationSetActive({ payload: { organizationId } })
|