@neondatabase/auth 0.1.0-beta.2 → 0.1.0-beta.20
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/README.md +112 -18
- package/dist/{adapter-core-C12KoaiU.d.mts → adapter-core-23fYTUxT.d.mts} +175 -627
- package/dist/{adapter-core-BDOw-gBC.mjs → adapter-core-8s6XdCco.mjs} +392 -69
- package/dist/{better-auth-react-adapter-FnBHa2nr.mjs → better-auth-react-adapter-D9tIaEyQ.mjs} +10 -8
- package/dist/better-auth-react-adapter-QFe5RtaM.d.mts +2170 -0
- package/dist/better-auth-types-BUiggBfa.d.mts +9 -0
- package/dist/chunk-VCZJYX65-CLnrj1o7-D6ZQkcc_.mjs +543 -0
- package/dist/constants-2bpp2_-f.mjs +30 -0
- package/dist/index-Bga0CzOO.d.mts +49 -0
- package/dist/index.d.mts +5 -98
- package/dist/index.mjs +2 -1
- package/dist/middleware-C7jHeulu.mjs +303 -0
- package/dist/{neon-auth-C9XTFffv.mjs → neon-auth-2f58U8_-.mjs} +7 -4
- package/dist/neon-auth-CDYpC_O1.d.mts +107 -0
- package/dist/next/index.d.mts +139 -303
- package/dist/next/index.mjs +37 -174
- package/dist/next/server/index.d.mts +389 -0
- package/dist/next/server/index.mjs +432 -0
- package/dist/react/adapters/index.d.mts +5 -4
- package/dist/react/adapters/index.mjs +2 -1
- package/dist/react/index.d.mts +6 -5
- package/dist/react/index.mjs +5 -92
- package/dist/react/ui/index.d.mts +1 -1
- package/dist/react/ui/index.mjs +3 -91
- package/dist/react/ui/server.mjs +1 -1
- package/dist/{supabase-adapter-ggmqWgPe.mjs → supabase-adapter-BYMJSxOT.mjs} +72 -167
- package/dist/supabase-adapter-Dr-pKvPt.d.mts +2258 -0
- package/dist/types/index.d.mts +4 -0
- package/dist/types/index.mjs +3 -0
- package/dist/ui/.safelist.html +3 -0
- package/dist/ui/css.css +2 -2
- package/dist/ui/tailwind.css +3 -2
- package/dist/ui/theme-inline.css +39 -0
- package/dist/ui/theme.css +125 -49
- package/dist/ui-Cg1EZzGG.mjs +12104 -0
- package/dist/vanilla/adapters/index.d.mts +4 -3
- package/dist/vanilla/adapters/index.mjs +2 -1
- package/dist/vanilla/index.d.mts +4 -3
- package/dist/vanilla/index.mjs +2 -1
- package/llms.txt +172 -0
- package/package.json +21 -10
- package/dist/better-auth-react-adapter-BXL48HIU.d.mts +0 -722
- package/dist/supabase-adapter-crabDnl2.d.mts +0 -128
- package/dist/ui-CNFBSekF.mjs +0 -401
- /package/dist/{adapters-Dkx0zoMR.mjs → adapters-B7YKkjaL.mjs} +0 -0
- /package/dist/{index-C-svZlpj.d.mts → index-BHI9uOzY.d.mts} +0 -0
- /package/dist/{index-DuDD6cIY.d.mts → index-CSe4aQIZ.d.mts} +0 -0
- /package/dist/{index-UW23fDSn.d.mts → index-LhFpnU-f.d.mts} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Session, User } from "better-auth/types";
|
|
2
|
+
import { BetterFetchError } from "@better-fetch/fetch";
|
|
3
|
+
|
|
4
|
+
//#region src/core/better-auth-types.d.ts
|
|
5
|
+
type BetterAuthSession = Session;
|
|
6
|
+
type BetterAuthUser = User;
|
|
7
|
+
type BetterAuthErrorResponse = BetterFetchError;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { BetterAuthSession as n, BetterAuthUser as r, BetterAuthErrorResponse as t };
|
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
import * as z$1 from "zod";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
|
|
5
|
+
//#region ../auth-ui/dist/chunk-VCZJYX65-CLnrj1o7.mjs
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return twMerge(clsx(inputs));
|
|
8
|
+
}
|
|
9
|
+
function isValidEmail(email) {
|
|
10
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
|
11
|
+
}
|
|
12
|
+
function getLocalizedError({ error, localization, localizeErrors = true }) {
|
|
13
|
+
var _a;
|
|
14
|
+
const DEFAULT_ERROR_MESSAGE = "Request failed";
|
|
15
|
+
if (!localizeErrors) {
|
|
16
|
+
if (error == null ? void 0 : error.message) return error.message;
|
|
17
|
+
if ((_a = error == null ? void 0 : error.error) == null ? void 0 : _a.message) return error.error.message;
|
|
18
|
+
return DEFAULT_ERROR_MESSAGE;
|
|
19
|
+
}
|
|
20
|
+
if (typeof error === "string") {
|
|
21
|
+
if (localization == null ? void 0 : localization[error]) return localization[error];
|
|
22
|
+
}
|
|
23
|
+
if (error == null ? void 0 : error.error) {
|
|
24
|
+
if (error.error.code) {
|
|
25
|
+
const errorCode = error.error.code;
|
|
26
|
+
if (localization == null ? void 0 : localization[errorCode]) return localization[errorCode];
|
|
27
|
+
}
|
|
28
|
+
return error.error.message || error.error.code || error.error.statusText || (localization == null ? void 0 : localization.REQUEST_FAILED);
|
|
29
|
+
}
|
|
30
|
+
return (error == null ? void 0 : error.message) || (localization == null ? void 0 : localization.REQUEST_FAILED) || DEFAULT_ERROR_MESSAGE;
|
|
31
|
+
}
|
|
32
|
+
function getSearchParam(paramName) {
|
|
33
|
+
return typeof window !== "undefined" ? new URLSearchParams(window.location.search).get(paramName) : null;
|
|
34
|
+
}
|
|
35
|
+
function getViewByPath(viewPaths, path) {
|
|
36
|
+
for (const key in viewPaths) if (viewPaths[key] === path) return key;
|
|
37
|
+
}
|
|
38
|
+
function getPasswordSchema(passwordValidation, localization) {
|
|
39
|
+
let schema = z$1.string().min(1, { message: localization == null ? void 0 : localization.PASSWORD_REQUIRED });
|
|
40
|
+
if (passwordValidation == null ? void 0 : passwordValidation.minLength) schema = schema.min(passwordValidation.minLength, { message: localization == null ? void 0 : localization.PASSWORD_TOO_SHORT });
|
|
41
|
+
if (passwordValidation == null ? void 0 : passwordValidation.maxLength) schema = schema.max(passwordValidation.maxLength, { message: localization == null ? void 0 : localization.PASSWORD_TOO_LONG });
|
|
42
|
+
if (passwordValidation == null ? void 0 : passwordValidation.regex) schema = schema.regex(passwordValidation.regex, { message: localization == null ? void 0 : localization.INVALID_PASSWORD });
|
|
43
|
+
return schema;
|
|
44
|
+
}
|
|
45
|
+
var ADMIN_ERROR_CODES = {
|
|
46
|
+
FAILED_TO_CREATE_USER: "Failed to create user",
|
|
47
|
+
USER_ALREADY_EXISTS: "User already exists",
|
|
48
|
+
YOU_CANNOT_BAN_YOURSELF: "You cannot ban yourself",
|
|
49
|
+
YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: "You are not allowed to change users role",
|
|
50
|
+
YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: "You are not allowed to create users",
|
|
51
|
+
YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: "You are not allowed to list users",
|
|
52
|
+
YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: "You are not allowed to list users sessions",
|
|
53
|
+
YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: "You are not allowed to ban users",
|
|
54
|
+
YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: "You are not allowed to impersonate users",
|
|
55
|
+
YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: "You are not allowed to revoke users sessions",
|
|
56
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: "You are not allowed to delete users",
|
|
57
|
+
YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: "You are not allowed to set users password",
|
|
58
|
+
BANNED_USER: "You have been banned from this application"
|
|
59
|
+
};
|
|
60
|
+
var ANONYMOUS_ERROR_CODES = {
|
|
61
|
+
FAILED_TO_CREATE_USER: "Failed to create user",
|
|
62
|
+
COULD_NOT_CREATE_SESSION: "Could not create session",
|
|
63
|
+
ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously"
|
|
64
|
+
};
|
|
65
|
+
var API_KEY_ERROR_CODES = {
|
|
66
|
+
INVALID_METADATA_TYPE: "metadata must be an object or undefined",
|
|
67
|
+
REFILL_AMOUNT_AND_INTERVAL_REQUIRED: "refillAmount is required when refillInterval is provided",
|
|
68
|
+
REFILL_INTERVAL_AND_AMOUNT_REQUIRED: "refillInterval is required when refillAmount is provided",
|
|
69
|
+
USER_BANNED: "User is banned",
|
|
70
|
+
UNAUTHORIZED_SESSION: "Unauthorized or invalid session",
|
|
71
|
+
KEY_NOT_FOUND: "API Key not found",
|
|
72
|
+
KEY_DISABLED: "API Key is disabled",
|
|
73
|
+
KEY_EXPIRED: "API Key has expired",
|
|
74
|
+
USAGE_EXCEEDED: "API Key has reached its usage limit",
|
|
75
|
+
KEY_NOT_RECOVERABLE: "API Key is not recoverable",
|
|
76
|
+
EXPIRES_IN_IS_TOO_SMALL: "The expiresIn is smaller than the predefined minimum value.",
|
|
77
|
+
EXPIRES_IN_IS_TOO_LARGE: "The expiresIn is larger than the predefined maximum value.",
|
|
78
|
+
INVALID_REMAINING: "The remaining count is either too large or too small.",
|
|
79
|
+
INVALID_PREFIX_LENGTH: "The prefix length is either too large or too small.",
|
|
80
|
+
INVALID_NAME_LENGTH: "The name length is either too large or too small.",
|
|
81
|
+
METADATA_DISABLED: "Metadata is disabled.",
|
|
82
|
+
RATE_LIMIT_EXCEEDED: "Rate limit exceeded.",
|
|
83
|
+
NO_VALUES_TO_UPDATE: "No values to update.",
|
|
84
|
+
KEY_DISABLED_EXPIRATION: "Custom key expiration values are disabled.",
|
|
85
|
+
INVALID_API_KEY: "Invalid API key.",
|
|
86
|
+
INVALID_USER_ID_FROM_API_KEY: "The user id from the API key is invalid.",
|
|
87
|
+
INVALID_API_KEY_GETTER_RETURN_TYPE: "API Key getter returned an invalid key type. Expected string.",
|
|
88
|
+
SERVER_ONLY_PROPERTY: "The property you're trying to set can only be set from the server auth instance only."
|
|
89
|
+
};
|
|
90
|
+
var BASE_ERROR_CODES = {
|
|
91
|
+
USER_NOT_FOUND: "User not found",
|
|
92
|
+
FAILED_TO_CREATE_USER: "Failed to create user",
|
|
93
|
+
FAILED_TO_CREATE_SESSION: "Failed to create session",
|
|
94
|
+
FAILED_TO_UPDATE_USER: "Failed to update user",
|
|
95
|
+
FAILED_TO_GET_SESSION: "Failed to get session",
|
|
96
|
+
INVALID_PASSWORD: "Invalid password",
|
|
97
|
+
INVALID_EMAIL: "Invalid email",
|
|
98
|
+
INVALID_EMAIL_OR_PASSWORD: "Invalid email or password",
|
|
99
|
+
SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked",
|
|
100
|
+
PROVIDER_NOT_FOUND: "Provider not found",
|
|
101
|
+
INVALID_TOKEN: "Invalid token",
|
|
102
|
+
ID_TOKEN_NOT_SUPPORTED: "id_token not supported",
|
|
103
|
+
FAILED_TO_GET_USER_INFO: "Failed to get user info",
|
|
104
|
+
USER_EMAIL_NOT_FOUND: "User email not found",
|
|
105
|
+
EMAIL_NOT_VERIFIED: "Email not verified",
|
|
106
|
+
PASSWORD_TOO_SHORT: "Password too short",
|
|
107
|
+
PASSWORD_TOO_LONG: "Password too long",
|
|
108
|
+
USER_ALREADY_EXISTS: "User already exists",
|
|
109
|
+
EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated",
|
|
110
|
+
CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found",
|
|
111
|
+
SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.",
|
|
112
|
+
FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account",
|
|
113
|
+
ACCOUNT_NOT_FOUND: "Account not found",
|
|
114
|
+
USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account."
|
|
115
|
+
};
|
|
116
|
+
var EXTERNAL_ERROR_CODES = {
|
|
117
|
+
VERIFICATION_FAILED: "Captcha verification failed",
|
|
118
|
+
MISSING_RESPONSE: "Missing CAPTCHA response",
|
|
119
|
+
UNKNOWN_ERROR: "Something went wrong"
|
|
120
|
+
};
|
|
121
|
+
var INTERNAL_ERROR_CODES = {
|
|
122
|
+
MISSING_SECRET_KEY: "Missing secret key",
|
|
123
|
+
SERVICE_UNAVAILABLE: "CAPTCHA service unavailable"
|
|
124
|
+
};
|
|
125
|
+
var CAPTCHA_ERROR_CODES = {
|
|
126
|
+
...EXTERNAL_ERROR_CODES,
|
|
127
|
+
...INTERNAL_ERROR_CODES
|
|
128
|
+
};
|
|
129
|
+
var EMAIL_OTP_ERROR_CODES = {
|
|
130
|
+
OTP_EXPIRED: "otp expired",
|
|
131
|
+
INVALID_OTP: "Invalid OTP",
|
|
132
|
+
INVALID_EMAIL: "Invalid email",
|
|
133
|
+
USER_NOT_FOUND: "User not found",
|
|
134
|
+
TOO_MANY_ATTEMPTS: "Too many attempts"
|
|
135
|
+
};
|
|
136
|
+
var GENERIC_OAUTH_ERROR_CODES = { INVALID_OAUTH_CONFIGURATION: "Invalid OAuth configuration" };
|
|
137
|
+
var HAVEIBEENPWNED_ERROR_CODES = { PASSWORD_COMPROMISED: "The password you entered has been compromised. Please choose a different password." };
|
|
138
|
+
var MULTI_SESSION_ERROR_CODES = { INVALID_SESSION_TOKEN: "Invalid session token" };
|
|
139
|
+
var ORGANIZATION_ERROR_CODES = {
|
|
140
|
+
YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization",
|
|
141
|
+
YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: "You have reached the maximum number of organizations",
|
|
142
|
+
ORGANIZATION_ALREADY_EXISTS: "Organization already exists",
|
|
143
|
+
ORGANIZATION_NOT_FOUND: "Organization not found",
|
|
144
|
+
USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: "User is not a member of the organization",
|
|
145
|
+
YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: "You are not allowed to update this organization",
|
|
146
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: "You are not allowed to delete this organization",
|
|
147
|
+
NO_ACTIVE_ORGANIZATION: "No active organization",
|
|
148
|
+
USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: "User is already a member of this organization",
|
|
149
|
+
MEMBER_NOT_FOUND: "Member not found",
|
|
150
|
+
ROLE_NOT_FOUND: "Role not found",
|
|
151
|
+
YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: "You are not allowed to create a new team",
|
|
152
|
+
TEAM_ALREADY_EXISTS: "Team already exists",
|
|
153
|
+
TEAM_NOT_FOUND: "Team not found",
|
|
154
|
+
YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: "You cannot leave the organization as the only owner",
|
|
155
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: "You are not allowed to delete this member",
|
|
156
|
+
YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: "You are not allowed to invite users to this organization",
|
|
157
|
+
USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: "User is already invited to this organization",
|
|
158
|
+
INVITATION_NOT_FOUND: "Invitation not found",
|
|
159
|
+
YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: "You are not the recipient of the invitation",
|
|
160
|
+
YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: "You are not allowed to cancel this invitation",
|
|
161
|
+
INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: "Inviter is no longer a member of the organization",
|
|
162
|
+
YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: "you are not allowed to invite user with this role",
|
|
163
|
+
FAILED_TO_RETRIEVE_INVITATION: "Failed to retrieve invitation",
|
|
164
|
+
YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: "You have reached the maximum number of teams",
|
|
165
|
+
UNABLE_TO_REMOVE_LAST_TEAM: "Unable to remove last team",
|
|
166
|
+
YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: "You are not allowed to update this member",
|
|
167
|
+
ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: "Organization membership limit reached",
|
|
168
|
+
YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to create teams in this organization",
|
|
169
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to delete teams in this organization",
|
|
170
|
+
YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: "You are not allowed to update this team",
|
|
171
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: "You are not allowed to delete this team",
|
|
172
|
+
INVITATION_LIMIT_REACHED: "Invitation limit reached"
|
|
173
|
+
};
|
|
174
|
+
var PASSKEY_ERROR_CODES = {
|
|
175
|
+
CHALLENGE_NOT_FOUND: "Challenge not found",
|
|
176
|
+
YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: "You are not allowed to register this passkey",
|
|
177
|
+
FAILED_TO_VERIFY_REGISTRATION: "Failed to verify registration",
|
|
178
|
+
PASSKEY_NOT_FOUND: "Passkey not found",
|
|
179
|
+
AUTHENTICATION_FAILED: "Authentication failed",
|
|
180
|
+
UNABLE_TO_CREATE_SESSION: "Unable to create session",
|
|
181
|
+
FAILED_TO_UPDATE_PASSKEY: "Failed to update passkey"
|
|
182
|
+
};
|
|
183
|
+
var PHONE_NUMBER_ERROR_CODES = {
|
|
184
|
+
INVALID_PHONE_NUMBER: "Invalid phone number",
|
|
185
|
+
PHONE_NUMBER_EXIST: "Phone number already exists",
|
|
186
|
+
INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password",
|
|
187
|
+
UNEXPECTED_ERROR: "Unexpected error",
|
|
188
|
+
OTP_NOT_FOUND: "OTP not found",
|
|
189
|
+
OTP_EXPIRED: "OTP expired",
|
|
190
|
+
INVALID_OTP: "Invalid OTP",
|
|
191
|
+
PHONE_NUMBER_NOT_VERIFIED: "Phone number not verified"
|
|
192
|
+
};
|
|
193
|
+
var STRIPE_ERROR_CODES = {
|
|
194
|
+
SUBSCRIPTION_NOT_FOUND: "Subscription not found",
|
|
195
|
+
SUBSCRIPTION_PLAN_NOT_FOUND: "Subscription plan not found",
|
|
196
|
+
ALREADY_SUBSCRIBED_PLAN: "You're already subscribed to this plan",
|
|
197
|
+
UNABLE_TO_CREATE_CUSTOMER: "Unable to create customer",
|
|
198
|
+
FAILED_TO_FETCH_PLANS: "Failed to fetch plans",
|
|
199
|
+
EMAIL_VERIFICATION_REQUIRED: "Email verification is required before you can subscribe to a plan",
|
|
200
|
+
SUBSCRIPTION_NOT_ACTIVE: "Subscription is not active",
|
|
201
|
+
SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION: "Subscription is not scheduled for cancellation"
|
|
202
|
+
};
|
|
203
|
+
var TEAM_ERROR_CODES = {
|
|
204
|
+
TEAM_LIMIT_REACHED: "Team limit reached for this organization",
|
|
205
|
+
TEAM_MEMBER_LIMIT_REACHED: "Team member limit reached for this team",
|
|
206
|
+
TEAM_NOT_FOUND: "Team not found",
|
|
207
|
+
TEAM_MEMBER_NOT_FOUND: "Team member not found",
|
|
208
|
+
TEAM_NAME_TOO_LONG: "Team name is too long",
|
|
209
|
+
CANNOT_REMOVE_LAST_TEAM: "Cannot remove the last team",
|
|
210
|
+
NOT_ORGANIZATION_MEMBER: "User is not a member of the organization",
|
|
211
|
+
ALREADY_TEAM_MEMBER: "User is already a member of this team",
|
|
212
|
+
INSUFFICIENT_TEAM_PERMISSIONS: "Insufficient permissions to perform this action on team"
|
|
213
|
+
};
|
|
214
|
+
var TWO_FACTOR_ERROR_CODES = {
|
|
215
|
+
OTP_NOT_ENABLED: "OTP not enabled",
|
|
216
|
+
OTP_HAS_EXPIRED: "OTP has expired",
|
|
217
|
+
TOTP_NOT_ENABLED: "TOTP not enabled",
|
|
218
|
+
TWO_FACTOR_NOT_ENABLED: "Two factor isn't enabled",
|
|
219
|
+
BACKUP_CODES_NOT_ENABLED: "Backup codes aren't enabled",
|
|
220
|
+
INVALID_BACKUP_CODE: "Invalid backup code",
|
|
221
|
+
INVALID_CODE: "Invalid code",
|
|
222
|
+
TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: "Too many attempts. Please request a new code.",
|
|
223
|
+
INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"
|
|
224
|
+
};
|
|
225
|
+
var USERNAME_ERROR_CODES = {
|
|
226
|
+
INVALID_USERNAME_OR_PASSWORD: "invalid username or password",
|
|
227
|
+
EMAIL_NOT_VERIFIED: "email not verified",
|
|
228
|
+
UNEXPECTED_ERROR: "unexpected error",
|
|
229
|
+
USERNAME_IS_ALREADY_TAKEN: "username is already taken. please try another.",
|
|
230
|
+
USERNAME_TOO_SHORT: "username is too short",
|
|
231
|
+
USERNAME_TOO_LONG: "username is too long",
|
|
232
|
+
INVALID_USERNAME: "username is invalid"
|
|
233
|
+
};
|
|
234
|
+
var authLocalization = {
|
|
235
|
+
APP: "App",
|
|
236
|
+
ACCOUNT: "Account",
|
|
237
|
+
ACCOUNTS: "Accounts",
|
|
238
|
+
ACCOUNTS_DESCRIPTION: "Switch between your currently signed in accounts.",
|
|
239
|
+
ACCOUNTS_INSTRUCTIONS: "Sign in to an additional account.",
|
|
240
|
+
ADD_ACCOUNT: "Add Account",
|
|
241
|
+
ADD_PASSKEY: "Add Passkey",
|
|
242
|
+
ALREADY_HAVE_AN_ACCOUNT: "Already have an account?",
|
|
243
|
+
AVATAR: "Avatar",
|
|
244
|
+
AVATAR_DESCRIPTION: "Click on the avatar to upload a custom one from your files.",
|
|
245
|
+
AVATAR_INSTRUCTIONS: "An avatar is optional but strongly recommended.",
|
|
246
|
+
BACKUP_CODE_REQUIRED: "Backup code is required",
|
|
247
|
+
BACKUP_CODES: "Backup Codes",
|
|
248
|
+
BACKUP_CODES_DESCRIPTION: "Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",
|
|
249
|
+
BACKUP_CODE_PLACEHOLDER: "Backup Code",
|
|
250
|
+
BACKUP_CODE: "Backup Code",
|
|
251
|
+
CANCEL: "Cancel",
|
|
252
|
+
CHANGE_PASSWORD: "Change Password",
|
|
253
|
+
CHANGE_PASSWORD_DESCRIPTION: "Enter your current password and a new password.",
|
|
254
|
+
CHANGE_PASSWORD_INSTRUCTIONS: "Please use 8 characters at minimum.",
|
|
255
|
+
CHANGE_PASSWORD_SUCCESS: "Your password has been changed.",
|
|
256
|
+
CONFIRM_PASSWORD: "Confirm Password",
|
|
257
|
+
CONFIRM_PASSWORD_PLACEHOLDER: "Confirm Password",
|
|
258
|
+
CONFIRM_PASSWORD_REQUIRED: "Confirm password is required",
|
|
259
|
+
CONTINUE_WITH_AUTHENTICATOR: "Continue with Authenticator",
|
|
260
|
+
COPIED_TO_CLIPBOARD: "Copied to clipboard",
|
|
261
|
+
COPY_TO_CLIPBOARD: "Copy to clipboard",
|
|
262
|
+
COPY_ALL_CODES: "Copy all codes",
|
|
263
|
+
CONTINUE: "Continue",
|
|
264
|
+
CURRENT_PASSWORD: "Current Password",
|
|
265
|
+
CURRENT_PASSWORD_PLACEHOLDER: "Current Password",
|
|
266
|
+
CURRENT_SESSION: "Current Session",
|
|
267
|
+
UPDATE: "Update",
|
|
268
|
+
DELETE: "Delete",
|
|
269
|
+
DELETE_AVATAR: "Delete Avatar",
|
|
270
|
+
DELETE_ACCOUNT: "Delete Account",
|
|
271
|
+
DELETE_ACCOUNT_DESCRIPTION: "Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",
|
|
272
|
+
DELETE_ACCOUNT_INSTRUCTIONS: "Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",
|
|
273
|
+
DELETE_ACCOUNT_VERIFY: "Please check your email to verify the deletion of your account.",
|
|
274
|
+
DELETE_ACCOUNT_SUCCESS: "Your account has been deleted.",
|
|
275
|
+
DISABLE_TWO_FACTOR: "Disable Two-Factor",
|
|
276
|
+
DISABLED_CREDENTIALS_DESCRIPTION: "Choose a provider to login to your account",
|
|
277
|
+
DONT_HAVE_AN_ACCOUNT: "Don't have an account?",
|
|
278
|
+
DONE: "Done",
|
|
279
|
+
EMAIL: "Email",
|
|
280
|
+
EMAIL_DESCRIPTION: "Enter the email address you want to use to log in.",
|
|
281
|
+
EMAIL_INSTRUCTIONS: "Please enter a valid email address.",
|
|
282
|
+
EMAIL_IS_THE_SAME: "Email is the same",
|
|
283
|
+
EMAIL_PLACEHOLDER: "m@example.com",
|
|
284
|
+
EMAIL_REQUIRED: "Email address is required",
|
|
285
|
+
EMAIL_VERIFY_CHANGE: "Please check your email to verify the change.",
|
|
286
|
+
EMAIL_VERIFICATION: "Please check your email for the verification link.",
|
|
287
|
+
ENABLE_TWO_FACTOR: "Enable Two-Factor",
|
|
288
|
+
IS_INVALID: "is invalid",
|
|
289
|
+
IS_REQUIRED: "is required",
|
|
290
|
+
IS_THE_SAME: "is the same",
|
|
291
|
+
FORGOT_AUTHENTICATOR: "Forgot authenticator?",
|
|
292
|
+
FORGOT_PASSWORD: "Forgot Password",
|
|
293
|
+
FORGOT_PASSWORD_ACTION: "Send reset link",
|
|
294
|
+
FORGOT_PASSWORD_DESCRIPTION: "Enter your email to reset your password",
|
|
295
|
+
FORGOT_PASSWORD_EMAIL: "Check your email for the password reset link.",
|
|
296
|
+
FORGOT_PASSWORD_LINK: "Forgot your password?",
|
|
297
|
+
LINK: "Link",
|
|
298
|
+
MAGIC_LINK: "Magic Link",
|
|
299
|
+
MAGIC_LINK_ACTION: "Send magic link",
|
|
300
|
+
MAGIC_LINK_DESCRIPTION: "Enter your email to receive a magic link",
|
|
301
|
+
MAGIC_LINK_EMAIL: "Check your email for the magic link",
|
|
302
|
+
EMAIL_OTP: "Email Code",
|
|
303
|
+
EMAIL_OTP_SEND_ACTION: "Send code",
|
|
304
|
+
EMAIL_OTP_VERIFY_ACTION: "Verify code",
|
|
305
|
+
EMAIL_OTP_DESCRIPTION: "Enter your email to receive a code",
|
|
306
|
+
EMAIL_OTP_VERIFICATION_SENT: "Please check your email for the verification code.",
|
|
307
|
+
NAME: "Name",
|
|
308
|
+
NAME_DESCRIPTION: "Please enter your full name, or a display name.",
|
|
309
|
+
NAME_INSTRUCTIONS: "Please use 32 characters at maximum.",
|
|
310
|
+
NAME_PLACEHOLDER: "Name",
|
|
311
|
+
NEW_PASSWORD: "New Password",
|
|
312
|
+
NEW_PASSWORD_PLACEHOLDER: "New Password",
|
|
313
|
+
NEW_PASSWORD_REQUIRED: "New password is required",
|
|
314
|
+
ONE_TIME_PASSWORD: "One-Time Password",
|
|
315
|
+
OR_CONTINUE_WITH: "Or continue with",
|
|
316
|
+
PASSKEY: "Passkey",
|
|
317
|
+
PASSKEYS: "Passkeys",
|
|
318
|
+
PASSKEYS_DESCRIPTION: "Manage your passkeys for secure access.",
|
|
319
|
+
PASSKEYS_INSTRUCTIONS: "Securely access your account without a password.",
|
|
320
|
+
PERSONAL_ACCOUNT: "Personal Account",
|
|
321
|
+
API_KEYS: "API Keys",
|
|
322
|
+
API_KEYS_DESCRIPTION: "Manage your API keys for secure access.",
|
|
323
|
+
API_KEYS_INSTRUCTIONS: "Generate API keys to access your account programmatically.",
|
|
324
|
+
CREATE_API_KEY: "Create API Key",
|
|
325
|
+
CREATE_API_KEY_DESCRIPTION: "Enter a unique name for your API key to differentiate it from other keys.",
|
|
326
|
+
API_KEY_NAME_PLACEHOLDER: "New API Key",
|
|
327
|
+
API_KEY_CREATED: "API Key Created",
|
|
328
|
+
CREATE_API_KEY_SUCCESS: "Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",
|
|
329
|
+
NEVER_EXPIRES: "Never Expires",
|
|
330
|
+
EXPIRES: "Expires",
|
|
331
|
+
NO_EXPIRATION: "No Expiration",
|
|
332
|
+
CREATE_ORGANIZATION: "Create Organization",
|
|
333
|
+
ORGANIZATION: "Organization",
|
|
334
|
+
ORGANIZATION_NAME: "Name",
|
|
335
|
+
ORGANIZATION_NAME_PLACEHOLDER: "Acme Inc.",
|
|
336
|
+
ORGANIZATION_NAME_DESCRIPTION: "This is your organization's visible name.",
|
|
337
|
+
ORGANIZATION_NAME_INSTRUCTIONS: "Please use 32 characters at maximum.",
|
|
338
|
+
ORGANIZATION_SLUG: "Slug URL",
|
|
339
|
+
ORGANIZATION_SLUG_DESCRIPTION: "This is your organization's URL namespace.",
|
|
340
|
+
ORGANIZATION_SLUG_INSTRUCTIONS: "Please use 48 characters at maximum.",
|
|
341
|
+
ORGANIZATION_SLUG_PLACEHOLDER: "acme-inc",
|
|
342
|
+
CREATE_ORGANIZATION_SUCCESS: "Organization created successfully",
|
|
343
|
+
PASSWORD: "Password",
|
|
344
|
+
PASSWORD_PLACEHOLDER: "Password",
|
|
345
|
+
PASSWORD_REQUIRED: "Password is required",
|
|
346
|
+
PASSWORDS_DO_NOT_MATCH: "Passwords do not match",
|
|
347
|
+
PROVIDERS: "Providers",
|
|
348
|
+
PROVIDERS_DESCRIPTION: "Connect your account with a third-party service.",
|
|
349
|
+
RECOVER_ACCOUNT: "Recover Account",
|
|
350
|
+
RECOVER_ACCOUNT_ACTION: "Recover account",
|
|
351
|
+
RECOVER_ACCOUNT_DESCRIPTION: "Please enter a backup code to access your account",
|
|
352
|
+
REMEMBER_ME: "Remember me",
|
|
353
|
+
RESEND_CODE: "Resend code",
|
|
354
|
+
RESEND_VERIFICATION_EMAIL: "Resend Verification Email",
|
|
355
|
+
RESET_PASSWORD: "Reset Password",
|
|
356
|
+
RESET_PASSWORD_ACTION: "Save new password",
|
|
357
|
+
RESET_PASSWORD_DESCRIPTION: "Enter your new password below",
|
|
358
|
+
RESET_PASSWORD_SUCCESS: "Password reset successfully",
|
|
359
|
+
REQUEST_FAILED: "Request failed",
|
|
360
|
+
REVOKE: "Revoke",
|
|
361
|
+
DELETE_API_KEY: "Delete API Key",
|
|
362
|
+
DELETE_API_KEY_CONFIRM: "Are you sure you want to delete this API key?",
|
|
363
|
+
API_KEY: "API Key",
|
|
364
|
+
SIGN_IN: "Sign In",
|
|
365
|
+
SIGN_IN_ACTION: "Login",
|
|
366
|
+
SIGN_IN_DESCRIPTION: "Enter your email below to login to your account",
|
|
367
|
+
SIGN_IN_USERNAME_DESCRIPTION: "Enter your username or email to login to your account",
|
|
368
|
+
SIGN_IN_WITH: "Sign in with",
|
|
369
|
+
SIGN_OUT: "Sign Out",
|
|
370
|
+
SIGN_UP: "Sign Up",
|
|
371
|
+
SIGN_UP_ACTION: "Create an account",
|
|
372
|
+
SIGN_UP_DESCRIPTION: "Enter your information to create an account",
|
|
373
|
+
SIGN_UP_EMAIL: "Check your email for the verification link.",
|
|
374
|
+
SESSIONS: "Sessions",
|
|
375
|
+
SESSIONS_DESCRIPTION: "Manage your active sessions and revoke access.",
|
|
376
|
+
SET_PASSWORD: "Set Password",
|
|
377
|
+
SET_PASSWORD_DESCRIPTION: "Click the button below to receive an email to set up a password for your account.",
|
|
378
|
+
SETTINGS: "Settings",
|
|
379
|
+
SAVE: "Save",
|
|
380
|
+
SECURITY: "Security",
|
|
381
|
+
SWITCH_ACCOUNT: "Switch Account",
|
|
382
|
+
TRUST_DEVICE: "Trust this device",
|
|
383
|
+
TWO_FACTOR: "Two-Factor",
|
|
384
|
+
TWO_FACTOR_ACTION: "Verify code",
|
|
385
|
+
TWO_FACTOR_DESCRIPTION: "Please enter your one-time password to continue",
|
|
386
|
+
TWO_FACTOR_CARD_DESCRIPTION: "Add an extra layer of security to your account.",
|
|
387
|
+
TWO_FACTOR_DISABLE_INSTRUCTIONS: "Please enter your password to disable 2FA.",
|
|
388
|
+
TWO_FACTOR_ENABLE_INSTRUCTIONS: "Please enter your password to enable 2FA.",
|
|
389
|
+
TWO_FACTOR_ENABLED: "Two-factor authentication has been enabled",
|
|
390
|
+
TWO_FACTOR_DISABLED: "Two-Factor Authentication has been disabled",
|
|
391
|
+
TWO_FACTOR_PROMPT: "Two-Factor Authentication",
|
|
392
|
+
TWO_FACTOR_TOTP_LABEL: "Scan the QR Code with your Authenticator",
|
|
393
|
+
SEND_VERIFICATION_CODE: "Send verification code",
|
|
394
|
+
UNLINK: "Unlink",
|
|
395
|
+
UPDATED_SUCCESSFULLY: "updated successfully",
|
|
396
|
+
USERNAME: "Username",
|
|
397
|
+
USERNAME_DESCRIPTION: "Enter the username you want to use to log in.",
|
|
398
|
+
USERNAME_INSTRUCTIONS: "Please use 32 characters at maximum.",
|
|
399
|
+
USERNAME_PLACEHOLDER: "Username",
|
|
400
|
+
OPTIONAL_BRACKETS: "(Optional)",
|
|
401
|
+
SIGN_IN_USERNAME_PLACEHOLDER: "Username or email",
|
|
402
|
+
VERIFY_YOUR_EMAIL: "Verify Your Email",
|
|
403
|
+
VERIFY_YOUR_EMAIL_DESCRIPTION: "Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",
|
|
404
|
+
GO_BACK: "Go back",
|
|
405
|
+
SESSION_NOT_FRESH: "Your session is not fresh. Please sign in again.",
|
|
406
|
+
UPLOAD_AVATAR: "Upload Avatar",
|
|
407
|
+
LOGO: "Logo",
|
|
408
|
+
LOGO_DESCRIPTION: "Click on the logo to upload a custom one from your files.",
|
|
409
|
+
LOGO_INSTRUCTIONS: "A logo is optional but strongly recommended.",
|
|
410
|
+
UPLOAD: "Upload",
|
|
411
|
+
UPLOAD_LOGO: "Upload Logo",
|
|
412
|
+
DELETE_LOGO: "Delete Logo",
|
|
413
|
+
PRIVACY_POLICY: "Privacy Policy",
|
|
414
|
+
TERMS_OF_SERVICE: "Terms of Service",
|
|
415
|
+
PROTECTED_BY_RECAPTCHA: "This site is protected by reCAPTCHA.",
|
|
416
|
+
BY_CONTINUING_YOU_AGREE: "By continuing, you agree to the",
|
|
417
|
+
USER: "User",
|
|
418
|
+
ORGANIZATIONS: "Organizations",
|
|
419
|
+
ORGANIZATIONS_DESCRIPTION: "Manage your organizations and memberships.",
|
|
420
|
+
ORGANIZATIONS_INSTRUCTIONS: "Create an organization to collaborate with other users.",
|
|
421
|
+
LEAVE_ORGANIZATION: "Leave Organization",
|
|
422
|
+
LEAVE_ORGANIZATION_CONFIRM: "Are you sure you want to leave this organization?",
|
|
423
|
+
LEAVE_ORGANIZATION_SUCCESS: "You have successfully left the organization.",
|
|
424
|
+
MANAGE_ORGANIZATION: "Manage Organization",
|
|
425
|
+
REMOVE_MEMBER: "Remove Member",
|
|
426
|
+
REMOVE_MEMBER_CONFIRM: "Are you sure you want to remove this member from the organization?",
|
|
427
|
+
REMOVE_MEMBER_SUCCESS: "Member removed successfully",
|
|
428
|
+
INVITE_MEMBER: "Invite Member",
|
|
429
|
+
MEMBERS: "Members",
|
|
430
|
+
MEMBERS_DESCRIPTION: "Add or remove members and manage their roles.",
|
|
431
|
+
MEMBERS_INSTRUCTIONS: "Invite new members to your organization.",
|
|
432
|
+
INVITE_MEMBER_DESCRIPTION: "Send an invitation to add a new member to your organization.",
|
|
433
|
+
ROLE: "Role",
|
|
434
|
+
SELECT_ROLE: "Select a role",
|
|
435
|
+
ADMIN: "Admin",
|
|
436
|
+
MEMBER: "Member",
|
|
437
|
+
GUEST: "Guest",
|
|
438
|
+
OWNER: "Owner",
|
|
439
|
+
UPDATE_ROLE_DESCRIPTION: "Update the role for this member",
|
|
440
|
+
UPDATE_ROLE: "Update Role",
|
|
441
|
+
MEMBER_ROLE_UPDATED: "Member role updated successfully",
|
|
442
|
+
SEND_INVITATION: "Send Invitation",
|
|
443
|
+
SEND_INVITATION_SUCCESS: "Invitation sent successfully",
|
|
444
|
+
PENDING_INVITATIONS: "Pending Invitations",
|
|
445
|
+
PENDING_INVITATIONS_DESCRIPTION: "Manage pending invitations to your organization.",
|
|
446
|
+
PENDING_USER_INVITATIONS_DESCRIPTION: "Invitations you've received from organizations.",
|
|
447
|
+
CANCEL_INVITATION: "Cancel Invitation",
|
|
448
|
+
INVITATION_CANCELLED: "Invitation cancelled successfully",
|
|
449
|
+
ACCEPT_INVITATION: "Accept Invitation",
|
|
450
|
+
ACCEPT_INVITATION_DESCRIPTION: "You have been invited to join an organization.",
|
|
451
|
+
INVITATION_ACCEPTED: "Invitation accepted successfully",
|
|
452
|
+
INVITATION_REJECTED: "Invitation rejected successfully",
|
|
453
|
+
ACCEPT: "Accept",
|
|
454
|
+
REJECT: "Reject",
|
|
455
|
+
INVITATION_EXPIRED: "This invitation has expired",
|
|
456
|
+
DELETE_ORGANIZATION: "Delete Organization",
|
|
457
|
+
DELETE_ORGANIZATION_DESCRIPTION: "Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",
|
|
458
|
+
DELETE_ORGANIZATION_SUCCESS: "Organization deleted successfully",
|
|
459
|
+
DELETE_ORGANIZATION_INSTRUCTIONS: "Enter the organization slug to continue:",
|
|
460
|
+
SLUG_REQUIRED: "Organization slug is required",
|
|
461
|
+
SLUG_DOES_NOT_MATCH: "The slug does not match",
|
|
462
|
+
TEAM: "Team",
|
|
463
|
+
TEAMS: "Teams",
|
|
464
|
+
TEAM_ACTIVE: "Active",
|
|
465
|
+
TEAM_SET_ACTIVE: "Set Active",
|
|
466
|
+
CREATE_TEAM: "Create Team",
|
|
467
|
+
CREATE_TEAM_SUCCESS: "Team created successfully",
|
|
468
|
+
UPDATE_TEAM: "Update Team",
|
|
469
|
+
UPDATE_TEAM_DESCRIPTION: "Update the name for this team",
|
|
470
|
+
REMOVE_TEAM_CONFIRM: "Are you sure you want to remove this team from the organization?",
|
|
471
|
+
CREATE_TEAM_INSTRUCTIONS: "Add new team to your organization.",
|
|
472
|
+
TEAM_NAME: "Team Name",
|
|
473
|
+
TEAM_NAME_PLACEHOLDER: "Engineering Team",
|
|
474
|
+
TEAM_NAME_DESCRIPTION: "This is your team's visible name.",
|
|
475
|
+
TEAM_NAME_INSTRUCTIONS: "Please use 64 characters at maximum.",
|
|
476
|
+
TEAMS_DESCRIPTION: "Manage your teams within your organization.",
|
|
477
|
+
USER_TEAMS_DESCRIPTION: "You are a member of the following teams.",
|
|
478
|
+
DELETE_TEAM: "Delete Team",
|
|
479
|
+
DELETE_TEAM_DESCRIPTION: "Permanently remove this team and all of its contents.",
|
|
480
|
+
DELETE_TEAM_SUCCESS: "Team deleted successfully",
|
|
481
|
+
DELETE_TEAM_INSTRUCTIONS: "Enter the team name to continue:",
|
|
482
|
+
TEAM_NAME_REQUIRED: "Team name is required",
|
|
483
|
+
TEAM_NAME_DOES_NOT_MATCH: "The team name does not match",
|
|
484
|
+
TEAM_MEMBERS: "Team Members",
|
|
485
|
+
TEAM_MEMBERS_DESCRIPTION: "Manage your team members and their roles.",
|
|
486
|
+
ADD_TEAM_MEMBER: "Add Team Member",
|
|
487
|
+
REMOVE_TEAM_MEMBER: "Remove Team Member",
|
|
488
|
+
REMOVE_TEAM_MEMBER_CONFIRM: "Are you sure you want to remove this member from the team?",
|
|
489
|
+
REMOVE_TEAM_MEMBER_SUCCESS: "Team member removed successfully",
|
|
490
|
+
ADD_TEAM_MEMBER_SUCCESS: "Team member added successfully",
|
|
491
|
+
UPDATE_TEAM_SUCCESS: "Team updated successfully",
|
|
492
|
+
MANAGE_TEAM_MEMBERS: "Manage Team Members",
|
|
493
|
+
MANAGE_TEAM_MEMBERS_DESCRIPTION: "Search and add organization members to this team.",
|
|
494
|
+
NO_TEAMS_FOUND: "No teams found",
|
|
495
|
+
MEMBER_SINGULAR: "member",
|
|
496
|
+
MEMBER_PLURAL: "members",
|
|
497
|
+
UNKNOWN: "Unknown",
|
|
498
|
+
...BASE_ERROR_CODES,
|
|
499
|
+
...ADMIN_ERROR_CODES,
|
|
500
|
+
...ANONYMOUS_ERROR_CODES,
|
|
501
|
+
...API_KEY_ERROR_CODES,
|
|
502
|
+
...CAPTCHA_ERROR_CODES,
|
|
503
|
+
...EMAIL_OTP_ERROR_CODES,
|
|
504
|
+
...GENERIC_OAUTH_ERROR_CODES,
|
|
505
|
+
...HAVEIBEENPWNED_ERROR_CODES,
|
|
506
|
+
...MULTI_SESSION_ERROR_CODES,
|
|
507
|
+
...ORGANIZATION_ERROR_CODES,
|
|
508
|
+
...PASSKEY_ERROR_CODES,
|
|
509
|
+
...PHONE_NUMBER_ERROR_CODES,
|
|
510
|
+
...STRIPE_ERROR_CODES,
|
|
511
|
+
...TEAM_ERROR_CODES,
|
|
512
|
+
...TWO_FACTOR_ERROR_CODES,
|
|
513
|
+
...USERNAME_ERROR_CODES
|
|
514
|
+
};
|
|
515
|
+
var authViewPaths = {
|
|
516
|
+
CALLBACK: "callback",
|
|
517
|
+
EMAIL_OTP: "email-otp",
|
|
518
|
+
FORGOT_PASSWORD: "forgot-password",
|
|
519
|
+
MAGIC_LINK: "magic-link",
|
|
520
|
+
RECOVER_ACCOUNT: "recover-account",
|
|
521
|
+
RESET_PASSWORD: "reset-password",
|
|
522
|
+
SIGN_IN: "sign-in",
|
|
523
|
+
SIGN_OUT: "sign-out",
|
|
524
|
+
SIGN_UP: "sign-up",
|
|
525
|
+
TWO_FACTOR: "two-factor",
|
|
526
|
+
ACCEPT_INVITATION: "accept-invitation"
|
|
527
|
+
};
|
|
528
|
+
var accountViewPaths = {
|
|
529
|
+
SETTINGS: "settings",
|
|
530
|
+
SECURITY: "security",
|
|
531
|
+
TEAMS: "teams",
|
|
532
|
+
API_KEYS: "api-keys",
|
|
533
|
+
ORGANIZATIONS: "organizations"
|
|
534
|
+
};
|
|
535
|
+
var organizationViewPaths = {
|
|
536
|
+
SETTINGS: "settings",
|
|
537
|
+
MEMBERS: "members",
|
|
538
|
+
TEAMS: "teams",
|
|
539
|
+
API_KEYS: "api-keys"
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
//#endregion
|
|
543
|
+
export { getLocalizedError as a, getViewByPath as c, cn as i, isValidEmail as l, authLocalization as n, getPasswordSchema as o, authViewPaths as r, getSearchParam as s, accountViewPaths as t, organizationViewPaths as u };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/core/constants.ts
|
|
2
|
+
/**
|
|
3
|
+
* Session caching configuration constants
|
|
4
|
+
*
|
|
5
|
+
* Uses industry-standard 60s cache TTL (common across auth providers).
|
|
6
|
+
*
|
|
7
|
+
* Note: Token refresh detection is now automatic via Better Auth's
|
|
8
|
+
* fetchOptions.onSuccess callback. No polling is needed.
|
|
9
|
+
*/
|
|
10
|
+
/** Session cache TTL in milliseconds (60 seconds) */
|
|
11
|
+
const SESSION_CACHE_TTL_MS = 6e4;
|
|
12
|
+
/** Clock skew buffer for token expiration checks in milliseconds (10 seconds) */
|
|
13
|
+
const CLOCK_SKEW_BUFFER_MS = 1e4;
|
|
14
|
+
/** Default session expiry duration in milliseconds (1 hour) */
|
|
15
|
+
const DEFAULT_SESSION_EXPIRY_MS = 36e5;
|
|
16
|
+
/** Name of the session verifier parameter in the URL, used for the OAUTH flow */
|
|
17
|
+
const NEON_AUTH_SESSION_VERIFIER_PARAM_NAME = "neon_auth_session_verifier";
|
|
18
|
+
/** Name of the popup marker parameter in the URL, used for OAuth popup flow in iframes */
|
|
19
|
+
const NEON_AUTH_POPUP_PARAM_NAME = "neon_popup";
|
|
20
|
+
/** Name of the original callback URL parameter, used in OAuth popup flow */
|
|
21
|
+
const NEON_AUTH_POPUP_CALLBACK_PARAM_NAME = "neon_popup_callback";
|
|
22
|
+
/** The callback route used for OAuth popup completion (must be in middleware SKIP_ROUTES) */
|
|
23
|
+
const NEON_AUTH_POPUP_CALLBACK_ROUTE = "/auth/callback";
|
|
24
|
+
/** Message type for OAuth popup completion postMessage */
|
|
25
|
+
const OAUTH_POPUP_MESSAGE_TYPE = "neon-auth:oauth-complete";
|
|
26
|
+
/** Prefix for all Neon Auth cookies */
|
|
27
|
+
const NEON_AUTH_COOKIE_PREFIX = "__Secure-neon-auth";
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { NEON_AUTH_POPUP_CALLBACK_ROUTE as a, OAUTH_POPUP_MESSAGE_TYPE as c, NEON_AUTH_POPUP_CALLBACK_PARAM_NAME as i, SESSION_CACHE_TTL_MS as l, DEFAULT_SESSION_EXPIRY_MS as n, NEON_AUTH_POPUP_PARAM_NAME as o, NEON_AUTH_COOKIE_PREFIX as r, NEON_AUTH_SESSION_VERIFIER_PARAM_NAME as s, CLOCK_SKEW_BUFFER_MS as t };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { n as BetterAuthSession, r as BetterAuthUser } from "./better-auth-types-BUiggBfa.mjs";
|
|
2
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
3
|
+
|
|
4
|
+
//#region src/next/auth/session.d.ts
|
|
5
|
+
type SessionData = {
|
|
6
|
+
session: BetterAuthSession;
|
|
7
|
+
user: BetterAuthUser;
|
|
8
|
+
} | {
|
|
9
|
+
session: null;
|
|
10
|
+
user: null;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A utility function to be used in react server components fetch the session details from the Neon Auth API, if session token is available in cookie.
|
|
14
|
+
*
|
|
15
|
+
* @returns - `{ session: Session, user: User }` | `{ session: null, user: null}`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { neonAuth } from "@neondatabase/auth/next"
|
|
20
|
+
*
|
|
21
|
+
* const { session, user } = await neonAuth()
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare const neonAuth: () => Promise<SessionData>;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/next/middleware/index.d.ts
|
|
27
|
+
type NeonAuthMiddlewareOptions = {
|
|
28
|
+
loginUrl?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A Next.js middleware to protect routes from unauthenticated requests and refresh the session if required.
|
|
32
|
+
*
|
|
33
|
+
* @param loginUrl - The URL to redirect to when the user is not authenticated.
|
|
34
|
+
* @returns A middleware function that can be used in the Next.js app.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { neonAuthMiddleware } from "@neondatabase/auth/next"
|
|
39
|
+
*
|
|
40
|
+
* export default neonAuthMiddleware({
|
|
41
|
+
* loginUrl: '/auth/sign-in',
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare function neonAuthMiddleware({
|
|
46
|
+
loginUrl
|
|
47
|
+
}: NeonAuthMiddlewareOptions): (request: NextRequest) => Promise<NextResponse<unknown>>;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { SessionData as n, neonAuth as r, neonAuthMiddleware as t };
|