@auth-gate/react-native 0.10.0 → 0.12.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/README.md +1 -1
- package/dist/index.cjs +8 -6
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.mjs +8 -6
- package/package.json +3 -2
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -146,12 +146,13 @@ var AuthGateNativeClient = class {
|
|
|
146
146
|
await this.handleAuthResult(result);
|
|
147
147
|
}
|
|
148
148
|
/** Sign in with email and password. May return MFA challenge. */
|
|
149
|
-
async loginWithEmail(email, password) {
|
|
149
|
+
async loginWithEmail(email, password, options) {
|
|
150
150
|
const callbackUrl = `${this.scheme}://${this.callbackPath}`;
|
|
151
151
|
const response = await this.core.emailSignin({
|
|
152
152
|
email,
|
|
153
153
|
password,
|
|
154
|
-
callbackUrl
|
|
154
|
+
callbackUrl,
|
|
155
|
+
locale: options == null ? void 0 : options.locale
|
|
155
156
|
});
|
|
156
157
|
const data = await response.json();
|
|
157
158
|
if (data.mfa_required) {
|
|
@@ -171,13 +172,14 @@ var AuthGateNativeClient = class {
|
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
174
|
/** Sign up with email and password. */
|
|
174
|
-
async signUp(email, password, name) {
|
|
175
|
+
async signUp(email, password, name, options) {
|
|
175
176
|
const callbackUrl = `${this.scheme}://${this.callbackPath}`;
|
|
176
177
|
const response = await this.core.emailSignup({
|
|
177
178
|
email,
|
|
178
179
|
password,
|
|
179
180
|
name,
|
|
180
|
-
callbackUrl
|
|
181
|
+
callbackUrl,
|
|
182
|
+
locale: options == null ? void 0 : options.locale
|
|
181
183
|
});
|
|
182
184
|
const data = await response.json();
|
|
183
185
|
if (data.token) {
|
|
@@ -190,9 +192,9 @@ var AuthGateNativeClient = class {
|
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
194
|
/** Send a magic link email. */
|
|
193
|
-
async sendMagicLink(email) {
|
|
195
|
+
async sendMagicLink(email, options) {
|
|
194
196
|
const callbackUrl = `${this.scheme}://${this.callbackPath}`;
|
|
195
|
-
const response = await this.core.magicLinkSend({ email, callbackUrl });
|
|
197
|
+
const response = await this.core.magicLinkSend({ email, callbackUrl, locale: options == null ? void 0 : options.locale });
|
|
196
198
|
if (!response.ok) {
|
|
197
199
|
const data = await response.json().catch(() => ({}));
|
|
198
200
|
throw new Error(data.error || `Magic link failed: ${response.status}`);
|
package/dist/index.d.cts
CHANGED
|
@@ -104,11 +104,17 @@ declare class AuthGateNativeClient {
|
|
|
104
104
|
/** Start an OAuth flow in the system browser. */
|
|
105
105
|
loginWithOAuth(provider: OAuthProvider): Promise<void>;
|
|
106
106
|
/** Sign in with email and password. May return MFA challenge. */
|
|
107
|
-
loginWithEmail(email: string, password: string
|
|
107
|
+
loginWithEmail(email: string, password: string, options?: {
|
|
108
|
+
locale?: string;
|
|
109
|
+
}): Promise<MfaChallengeResult | void>;
|
|
108
110
|
/** Sign up with email and password. */
|
|
109
|
-
signUp(email: string, password: string, name?: string
|
|
111
|
+
signUp(email: string, password: string, name?: string, options?: {
|
|
112
|
+
locale?: string;
|
|
113
|
+
}): Promise<void>;
|
|
110
114
|
/** Send a magic link email. */
|
|
111
|
-
sendMagicLink(email: string
|
|
115
|
+
sendMagicLink(email: string, options?: {
|
|
116
|
+
locale?: string;
|
|
117
|
+
}): Promise<void>;
|
|
112
118
|
/** Send an SMS verification code. */
|
|
113
119
|
sendSmsCode(phone: string): Promise<void>;
|
|
114
120
|
/** Verify an SMS code and complete authentication. */
|
package/dist/index.d.ts
CHANGED
|
@@ -104,11 +104,17 @@ declare class AuthGateNativeClient {
|
|
|
104
104
|
/** Start an OAuth flow in the system browser. */
|
|
105
105
|
loginWithOAuth(provider: OAuthProvider): Promise<void>;
|
|
106
106
|
/** Sign in with email and password. May return MFA challenge. */
|
|
107
|
-
loginWithEmail(email: string, password: string
|
|
107
|
+
loginWithEmail(email: string, password: string, options?: {
|
|
108
|
+
locale?: string;
|
|
109
|
+
}): Promise<MfaChallengeResult | void>;
|
|
108
110
|
/** Sign up with email and password. */
|
|
109
|
-
signUp(email: string, password: string, name?: string
|
|
111
|
+
signUp(email: string, password: string, name?: string, options?: {
|
|
112
|
+
locale?: string;
|
|
113
|
+
}): Promise<void>;
|
|
110
114
|
/** Send a magic link email. */
|
|
111
|
-
sendMagicLink(email: string
|
|
115
|
+
sendMagicLink(email: string, options?: {
|
|
116
|
+
locale?: string;
|
|
117
|
+
}): Promise<void>;
|
|
112
118
|
/** Send an SMS verification code. */
|
|
113
119
|
sendSmsCode(phone: string): Promise<void>;
|
|
114
120
|
/** Verify an SMS code and complete authentication. */
|
package/dist/index.mjs
CHANGED
|
@@ -111,12 +111,13 @@ var AuthGateNativeClient = class {
|
|
|
111
111
|
await this.handleAuthResult(result);
|
|
112
112
|
}
|
|
113
113
|
/** Sign in with email and password. May return MFA challenge. */
|
|
114
|
-
async loginWithEmail(email, password) {
|
|
114
|
+
async loginWithEmail(email, password, options) {
|
|
115
115
|
const callbackUrl = `${this.scheme}://${this.callbackPath}`;
|
|
116
116
|
const response = await this.core.emailSignin({
|
|
117
117
|
email,
|
|
118
118
|
password,
|
|
119
|
-
callbackUrl
|
|
119
|
+
callbackUrl,
|
|
120
|
+
locale: options == null ? void 0 : options.locale
|
|
120
121
|
});
|
|
121
122
|
const data = await response.json();
|
|
122
123
|
if (data.mfa_required) {
|
|
@@ -136,13 +137,14 @@ var AuthGateNativeClient = class {
|
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
/** Sign up with email and password. */
|
|
139
|
-
async signUp(email, password, name) {
|
|
140
|
+
async signUp(email, password, name, options) {
|
|
140
141
|
const callbackUrl = `${this.scheme}://${this.callbackPath}`;
|
|
141
142
|
const response = await this.core.emailSignup({
|
|
142
143
|
email,
|
|
143
144
|
password,
|
|
144
145
|
name,
|
|
145
|
-
callbackUrl
|
|
146
|
+
callbackUrl,
|
|
147
|
+
locale: options == null ? void 0 : options.locale
|
|
146
148
|
});
|
|
147
149
|
const data = await response.json();
|
|
148
150
|
if (data.token) {
|
|
@@ -155,9 +157,9 @@ var AuthGateNativeClient = class {
|
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
/** Send a magic link email. */
|
|
158
|
-
async sendMagicLink(email) {
|
|
160
|
+
async sendMagicLink(email, options) {
|
|
159
161
|
const callbackUrl = `${this.scheme}://${this.callbackPath}`;
|
|
160
|
-
const response = await this.core.magicLinkSend({ email, callbackUrl });
|
|
162
|
+
const response = await this.core.magicLinkSend({ email, callbackUrl, locale: options == null ? void 0 : options.locale });
|
|
161
163
|
if (!response.ok) {
|
|
162
164
|
const data = await response.json().catch(() => ({}));
|
|
163
165
|
throw new Error(data.error || `Magic link failed: ${response.status}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auth-gate/react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
|
+
"description": "React Native / Expo SDK for AuthGate — drop-in authentication with OAuth, email, SMS, and MFA for mobile apps.",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"exports": {
|
|
6
7
|
".": {
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
"icon.png"
|
|
18
19
|
],
|
|
19
20
|
"dependencies": {
|
|
20
|
-
"@auth-gate/core": "0.
|
|
21
|
+
"@auth-gate/core": "0.12.0"
|
|
21
22
|
},
|
|
22
23
|
"peerDependencies": {
|
|
23
24
|
"react": ">=18",
|