@lowdefy/actions-core 6.1.0 → 7.1.0
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/actions/AcceptInvitation/AcceptInvitation.js +21 -0
- package/dist/actions/AcceptInvitation/schema.js +16 -0
- package/dist/actions/ChangePassword/ChangePassword.js +18 -0
- package/dist/actions/ChangePassword/schema.js +25 -0
- package/dist/actions/EmailOtpSend/EmailOtpSend.js +21 -0
- package/dist/actions/EmailOtpSend/schema.js +34 -0
- package/dist/actions/EmailOtpVerify/EmailOtpVerify.js +22 -0
- package/dist/actions/EmailOtpVerify/schema.js +71 -0
- package/dist/actions/GetLocalStorage/GetLocalStorage.js +45 -0
- package/dist/actions/GetLocalStorage/schema.js +35 -0
- package/dist/actions/LeaveOrganization/LeaveOrganization.js +22 -0
- package/dist/actions/LeaveOrganization/schema.js +3 -0
- package/dist/actions/Link/schema.js +19 -1
- package/dist/actions/ListOrganizations/ListOrganizations.js +21 -0
- package/dist/actions/ListOrganizations/schema.js +17 -0
- package/dist/actions/Login/schema.js +120 -2
- package/dist/actions/Logout/schema.js +45 -2
- package/dist/actions/MagicLinkVerify/MagicLinkVerify.js +24 -0
- package/dist/actions/MagicLinkVerify/schema.js +64 -0
- package/dist/actions/OAuthConsent/OAuthConsent.js +24 -0
- package/dist/actions/OAuthConsent/schema.js +38 -0
- package/dist/actions/OAuthContinue/OAuthContinue.js +27 -0
- package/dist/actions/OAuthContinue/schema.js +22 -0
- package/dist/actions/PasskeyDelete/PasskeyDelete.js +18 -0
- package/dist/actions/PasskeyDelete/schema.js +16 -0
- package/dist/actions/PasskeyRegister/PasskeyRegister.js +21 -0
- package/dist/actions/PasskeyRegister/schema.js +21 -0
- package/dist/actions/PasskeySignIn/PasskeySignIn.js +21 -0
- package/dist/actions/PasskeySignIn/schema.js +59 -0
- package/dist/actions/PasskeyUpdate/PasskeyUpdate.js +18 -0
- package/dist/actions/PasskeyUpdate/schema.js +21 -0
- package/dist/actions/PhoneNumberSendOtp/PhoneNumberSendOtp.js +20 -0
- package/dist/actions/PhoneNumberSendOtp/schema.js +20 -0
- package/dist/actions/PhoneNumberVerify/PhoneNumberVerify.js +22 -0
- package/dist/actions/PhoneNumberVerify/schema.js +79 -0
- package/dist/actions/RemoveLocalStorage/RemoveLocalStorage.js +38 -0
- package/dist/actions/RemoveLocalStorage/schema.js +32 -0
- package/dist/actions/RequestPasswordReset/RequestPasswordReset.js +18 -0
- package/dist/actions/RequestPasswordReset/schema.js +25 -0
- package/dist/actions/ResetPassword/ResetPassword.js +18 -0
- package/dist/actions/ResetPassword/schema.js +28 -0
- package/dist/actions/ResetValidation/schema.js +42 -0
- package/dist/actions/RevokeOtherSessions/RevokeOtherSessions.js +20 -0
- package/dist/actions/RevokeOtherSessions/schema.js +6 -0
- package/dist/actions/SendVerificationEmail/SendVerificationEmail.js +20 -0
- package/dist/actions/SendVerificationEmail/schema.js +60 -0
- package/dist/actions/SetActiveOrganization/SetActiveOrganization.js +21 -0
- package/dist/actions/SetActiveOrganization/schema.js +17 -0
- package/dist/actions/SetDarkMode/SetDarkMode.js +2 -1
- package/dist/actions/SetLocalStorage/SetLocalStorage.js +43 -0
- package/dist/actions/SetLocalStorage/schema.js +36 -0
- package/dist/actions/SignUp/SignUp.js +18 -0
- package/dist/actions/SignUp/schema.js +65 -0
- package/dist/actions/TwoFactorDisable/TwoFactorDisable.js +18 -0
- package/dist/actions/TwoFactorDisable/schema.js +16 -0
- package/dist/actions/TwoFactorEnable/TwoFactorEnable.js +21 -0
- package/dist/actions/TwoFactorEnable/schema.js +16 -0
- package/dist/actions/TwoFactorGenerateBackupCodes/TwoFactorGenerateBackupCodes.js +21 -0
- package/dist/actions/TwoFactorGenerateBackupCodes/schema.js +16 -0
- package/dist/actions/TwoFactorVerify/TwoFactorVerify.js +21 -0
- package/dist/actions/TwoFactorVerify/schema.js +71 -0
- package/dist/actions/Validate/schema.js +42 -0
- package/dist/actions.js +29 -1
- package/dist/localStorage/parseStoredValue.js +28 -0
- package/dist/localStorage/readAppStorageItem.js +35 -0
- package/dist/localStorage/validateStorageKey.js +30 -0
- package/dist/schemas.js +29 -1
- package/dist/types.js +28 -0
- package/package.json +8 -4
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Accepts an organization invitation. The action does not re-check that the
|
|
16
|
+
// session email matches the invitation email - BetterAuth's endpoint
|
|
17
|
+
// enforces it.
|
|
18
|
+
function AcceptInvitation({ methods: { acceptInvitation }, params }) {
|
|
19
|
+
return acceptInvitation(params);
|
|
20
|
+
}
|
|
21
|
+
export default AcceptInvitation;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: 'object',
|
|
3
|
+
params: {
|
|
4
|
+
type: 'object',
|
|
5
|
+
description: 'Parameters identifying the invitation to accept.',
|
|
6
|
+
required: [
|
|
7
|
+
'invitationId'
|
|
8
|
+
],
|
|
9
|
+
properties: {
|
|
10
|
+
invitationId: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
description: 'Id of the invitation to accept.'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ function ChangePassword({ methods: { changePassword }, params }) {
|
|
16
|
+
return changePassword(params);
|
|
17
|
+
}
|
|
18
|
+
export default ChangePassword;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: 'object',
|
|
3
|
+
params: {
|
|
4
|
+
type: 'object',
|
|
5
|
+
description: 'Parameters passed to the change-password method.',
|
|
6
|
+
required: [
|
|
7
|
+
'currentPassword',
|
|
8
|
+
'newPassword'
|
|
9
|
+
],
|
|
10
|
+
properties: {
|
|
11
|
+
currentPassword: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: 'The current password of the signed-in user.'
|
|
14
|
+
},
|
|
15
|
+
newPassword: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'The new password to set.'
|
|
18
|
+
},
|
|
19
|
+
revokeOtherSessions: {
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
description: 'Revoke all other sessions after the password change.'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Sends a one-time sign-in code to the email address. The code-only entry
|
|
16
|
+
// point: when magicLink is also enabled, Login with magicLink: true already
|
|
17
|
+
// sends one email carrying both the link and the code.
|
|
18
|
+
function EmailOtpSend({ methods: { emailOtpSend }, params }) {
|
|
19
|
+
return emailOtpSend(params);
|
|
20
|
+
}
|
|
21
|
+
export default EmailOtpSend;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
description: 'Parameters passed to the email one-time-code send method.',
|
|
20
|
+
required: [
|
|
21
|
+
'email'
|
|
22
|
+
],
|
|
23
|
+
properties: {
|
|
24
|
+
email: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Email address to send the sign-in code to.'
|
|
27
|
+
},
|
|
28
|
+
captchaToken: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'Captcha token minted by a Captcha block, sent as the x-captcha-response header when auth.captcha is enabled. Tokens are single-use - reset the Captcha block in onError for retries.'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Signs the user in with the emailed one-time code. On success the session
|
|
16
|
+
// cookie is set (creating the user on first sign-in unless disableSignUp) and
|
|
17
|
+
// the browser lands on the resolved callbackUrl - or on the two-factor
|
|
18
|
+
// challenge page when the user is enrolled.
|
|
19
|
+
function EmailOtpVerify({ methods: { emailOtpVerify }, params }) {
|
|
20
|
+
return emailOtpVerify(params);
|
|
21
|
+
}
|
|
22
|
+
export default EmailOtpVerify;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
description: 'Parameters passed to the email one-time-code verify method.',
|
|
20
|
+
required: [
|
|
21
|
+
'email',
|
|
22
|
+
'otp'
|
|
23
|
+
],
|
|
24
|
+
properties: {
|
|
25
|
+
email: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'Email address the code was sent to.'
|
|
28
|
+
},
|
|
29
|
+
otp: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'The one-time code from the email.'
|
|
32
|
+
},
|
|
33
|
+
callbackUrl: {
|
|
34
|
+
oneOf: [
|
|
35
|
+
{
|
|
36
|
+
type: 'object',
|
|
37
|
+
description: "Structured callback target for where a successful sign-in lands, basePath-prefixed. Defaults to the app's home page when omitted and no ?callbackUrl= query is present; a ?callbackUrl= query set by the unauthenticated-page redirect wins over that default, and this param wins over both.",
|
|
38
|
+
properties: {
|
|
39
|
+
home: {
|
|
40
|
+
type: 'boolean',
|
|
41
|
+
description: "Land on the app's home page."
|
|
42
|
+
},
|
|
43
|
+
pageId: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'The pageId to land on.'
|
|
46
|
+
},
|
|
47
|
+
url: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external landing page.'
|
|
50
|
+
},
|
|
51
|
+
urlQuery: {
|
|
52
|
+
type: 'object',
|
|
53
|
+
description: 'The urlQuery to set on the destination.'
|
|
54
|
+
},
|
|
55
|
+
pathParams: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
description: "Values for the placeholders in the destination page's path, by placeholder name."
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
enum: [
|
|
63
|
+
false
|
|
64
|
+
],
|
|
65
|
+
description: 'Do not navigate - the session store re-renders the page with the new user in place, for a sign-in form in a modal or an embedded panel.'
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
import parseStoredValue from '../../localStorage/parseStoredValue.js';
|
|
17
|
+
import readAppStorageItem from '../../localStorage/readAppStorageItem.js';
|
|
18
|
+
import validateStorageKey from '../../localStorage/validateStorageKey.js';
|
|
19
|
+
function GetLocalStorage({ globals, methods, params }) {
|
|
20
|
+
if (!type.isObject(params)) {
|
|
21
|
+
throw new Error('GetLocalStorage params should be an object.');
|
|
22
|
+
}
|
|
23
|
+
const { key } = params;
|
|
24
|
+
validateStorageKey({
|
|
25
|
+
actionType: 'GetLocalStorage',
|
|
26
|
+
key
|
|
27
|
+
});
|
|
28
|
+
let item;
|
|
29
|
+
try {
|
|
30
|
+
item = readAppStorageItem({
|
|
31
|
+
appKey: methods.getAppStorageKey(key),
|
|
32
|
+
key,
|
|
33
|
+
storage: globals.window.localStorage
|
|
34
|
+
});
|
|
35
|
+
} catch {
|
|
36
|
+
// The browser blocks storage access (e.g. Safari with site data disabled), so read it as
|
|
37
|
+
// not set - the user's browser settings are not an app config error.
|
|
38
|
+
return params.default;
|
|
39
|
+
}
|
|
40
|
+
if (type.isNone(item)) {
|
|
41
|
+
return params.default;
|
|
42
|
+
}
|
|
43
|
+
return parseStoredValue(item);
|
|
44
|
+
}
|
|
45
|
+
export default GetLocalStorage;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
required: [
|
|
20
|
+
'key'
|
|
21
|
+
],
|
|
22
|
+
properties: {
|
|
23
|
+
key: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
minLength: 1,
|
|
26
|
+
pattern: '^(?!lowdefy_|lf-)',
|
|
27
|
+
description: 'The local storage key to read. Keys starting with "lowdefy_" or "lf-" are reserved for Lowdefy.'
|
|
28
|
+
},
|
|
29
|
+
default: {
|
|
30
|
+
description: 'The value returned when the key is not set in local storage.'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
additionalProperties: false
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Removes the caller's own membership from their active organization - the
|
|
16
|
+
// active org id is resolved from the session, so the action takes no params.
|
|
17
|
+
// Membership and roles resolve server-side - chain UpdateSession after to
|
|
18
|
+
// re-sync the client.
|
|
19
|
+
function LeaveOrganization({ methods: { leaveOrganization } }) {
|
|
20
|
+
return leaveOrganization();
|
|
21
|
+
}
|
|
22
|
+
export default LeaveOrganization;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
2
16
|
type: 'object',
|
|
3
17
|
params: {
|
|
4
18
|
oneOf: [
|
|
@@ -26,6 +40,10 @@ export default {
|
|
|
26
40
|
type: 'object',
|
|
27
41
|
description: 'URL query parameters.'
|
|
28
42
|
},
|
|
43
|
+
pathParams: {
|
|
44
|
+
type: 'object',
|
|
45
|
+
description: "Values for the placeholders in the page's path, by placeholder name."
|
|
46
|
+
},
|
|
29
47
|
input: {
|
|
30
48
|
type: 'object',
|
|
31
49
|
description: 'Input to pass to the linked page.'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Returns the signed-in user's own organization memberships from BetterAuth
|
|
16
|
+
// - keyed on the session alone, not the active organization, so a page can
|
|
17
|
+
// list every workspace the caller belongs to. The action takes no params.
|
|
18
|
+
function ListOrganizations({ methods: { listOrganizations } }) {
|
|
19
|
+
return listOrganizations();
|
|
20
|
+
}
|
|
21
|
+
export default ListOrganizations;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
16
|
+
type: 'object'
|
|
17
|
+
};
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
2
16
|
type: 'object',
|
|
3
17
|
params: {
|
|
4
18
|
type: 'object',
|
|
@@ -8,9 +22,113 @@ export default {
|
|
|
8
22
|
type: 'string',
|
|
9
23
|
description: 'The authentication provider ID.'
|
|
10
24
|
},
|
|
25
|
+
email: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'Email address for email and password or magic-link sign-in.'
|
|
28
|
+
},
|
|
29
|
+
password: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'Password for email and password or phone and password sign-in.'
|
|
32
|
+
},
|
|
33
|
+
phoneNumber: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: 'Phone number for phone and password sign-in, in E.164 format (e.g. "+27831234567").'
|
|
36
|
+
},
|
|
37
|
+
magicLink: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
description: 'Send a magic sign-in link to the email address instead of using a password.'
|
|
40
|
+
},
|
|
11
41
|
callbackUrl: {
|
|
42
|
+
oneOf: [
|
|
43
|
+
{
|
|
44
|
+
type: 'object',
|
|
45
|
+
description: "Structured callback target for where a successful sign-in lands, basePath-prefixed. Defaults to the app's home page when omitted and no ?callbackUrl= query is present; a ?callbackUrl= query set by the unauthenticated-page redirect wins over that default, and this param wins over both.",
|
|
46
|
+
properties: {
|
|
47
|
+
home: {
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
description: "Land on the app's home page."
|
|
50
|
+
},
|
|
51
|
+
pageId: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
description: 'The pageId to land on.'
|
|
54
|
+
},
|
|
55
|
+
url: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external landing page.'
|
|
58
|
+
},
|
|
59
|
+
urlQuery: {
|
|
60
|
+
type: 'object',
|
|
61
|
+
description: 'The urlQuery to set on the destination.'
|
|
62
|
+
},
|
|
63
|
+
pathParams: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
description: "Values for the placeholders in the destination page's path, by placeholder name."
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
enum: [
|
|
71
|
+
false
|
|
72
|
+
],
|
|
73
|
+
description: 'Do not navigate - the session store re-renders the page with the new user in place, for a login form in a modal or an embedded panel. Not valid for magic-link or social/OAuth sign-in, which redirect through an external hop.'
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
newUserCallbackUrl: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
description: 'Structured callback target for where a first-time user lands after a magic link (or social/OAuth sign-in) creates their account. Resolved like callbackUrl - basePath-prefixed. When omitted, BetterAuth defaults it to callbackUrl. Ignored by email and phone sign-in.',
|
|
80
|
+
properties: {
|
|
81
|
+
home: {
|
|
82
|
+
type: 'boolean',
|
|
83
|
+
description: "Land on the app's home page."
|
|
84
|
+
},
|
|
85
|
+
pageId: {
|
|
86
|
+
type: 'string',
|
|
87
|
+
description: 'The pageId to land on.'
|
|
88
|
+
},
|
|
89
|
+
url: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external landing page.'
|
|
92
|
+
},
|
|
93
|
+
urlQuery: {
|
|
94
|
+
type: 'object',
|
|
95
|
+
description: 'The urlQuery to set on the destination.'
|
|
96
|
+
},
|
|
97
|
+
pathParams: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
description: "Values for the placeholders in the destination page's path, by placeholder name."
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
errorCallbackUrl: {
|
|
104
|
+
type: 'object',
|
|
105
|
+
description: "Structured callback target for where a failed or expired magic link (or social/OAuth sign-in) lands, carrying the ?error= reason. Resolved like callbackUrl - basePath-prefixed. When omitted, defaults to the app's authPages.error page (basePath-prefixed); if authPages.error is unset, BetterAuth's own fallback stands. Ignored by email and phone sign-in.",
|
|
106
|
+
properties: {
|
|
107
|
+
home: {
|
|
108
|
+
type: 'boolean',
|
|
109
|
+
description: "Land on the app's home page."
|
|
110
|
+
},
|
|
111
|
+
pageId: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
description: 'The pageId to land on.'
|
|
114
|
+
},
|
|
115
|
+
url: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external landing page.'
|
|
118
|
+
},
|
|
119
|
+
urlQuery: {
|
|
120
|
+
type: 'object',
|
|
121
|
+
description: 'The urlQuery to set on the destination.'
|
|
122
|
+
},
|
|
123
|
+
pathParams: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
description: "Values for the placeholders in the destination page's path, by placeholder name."
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
captchaToken: {
|
|
12
130
|
type: 'string',
|
|
13
|
-
description: '
|
|
131
|
+
description: 'Captcha token minted by a Captcha block, sent as the x-captcha-response header when auth.captcha is enabled. Tokens are single-use - reset the Captcha block in onError for retries.'
|
|
14
132
|
}
|
|
15
133
|
}
|
|
16
134
|
}
|
|
@@ -1,6 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
2
16
|
type: 'object',
|
|
3
17
|
params: {
|
|
4
|
-
|
|
18
|
+
type: 'object',
|
|
19
|
+
description: 'Parameters passed to the logout method.',
|
|
20
|
+
properties: {
|
|
21
|
+
callbackUrl: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
description: 'Structured callback target for where a signed-out user lands, basePath-prefixed. Unlike the sign-in actions this has no default and does not read the ?callbackUrl= query: with no target the session provider reloads the page and the server re-applies the page auth fork, which sends a protected page to the sign-in page.',
|
|
24
|
+
properties: {
|
|
25
|
+
home: {
|
|
26
|
+
type: 'boolean',
|
|
27
|
+
description: "Land on the app's home page."
|
|
28
|
+
},
|
|
29
|
+
pageId: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'The pageId to land on.'
|
|
32
|
+
},
|
|
33
|
+
url: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external logout landing page.'
|
|
36
|
+
},
|
|
37
|
+
urlQuery: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
description: 'The urlQuery to set on the destination.'
|
|
40
|
+
},
|
|
41
|
+
pathParams: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
description: "Values for the placeholders in the destination page's path, by placeholder name."
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
5
48
|
}
|
|
6
49
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Spends the magic-link token from the landing page the sign-in email points
|
|
16
|
+
// at (auth.authPages.magicLink). The browser navigates to BetterAuth's verify
|
|
17
|
+
// endpoint, which sets the session cookie and redirects on, so the event chain
|
|
18
|
+
// ends here. Bind it to a real click: the landing page exists precisely because
|
|
19
|
+
// mail-security link scanners fetch the page, and a token spent on mount would
|
|
20
|
+
// be consumed by the scanner all the same.
|
|
21
|
+
function MagicLinkVerify({ methods: { magicLinkVerify }, params }) {
|
|
22
|
+
return magicLinkVerify(params);
|
|
23
|
+
}
|
|
24
|
+
export default MagicLinkVerify;
|