Skip to content

Commit 0378257

Browse files
committed
chore: Clean up
1 parent 5db2bb6 commit 0378257

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

packages/clerk-js/sandbox/template.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@
358358
<script
359359
type="text/javascript"
360360
src="/<%= htmlRspackPlugin.files.js[0] %>"
361-
data-clerk-publishable-key="pk_test_dG91Y2hlZC1sYWR5YmlyZC0yMy5jbGVyay5hY2NvdW50cy5kZXYk"
361+
data-clerk-publishable-key-setup-vs-unlock-local="pk_test_bW9yZS1oYXJlLTMzLmNsZXJrLmFjY291bnRzLmxjbGNsZXJrLmNvbSQ"
362+
data-clerk-publishable-key-easie="pk_test_dG91Y2hlZC1sYWR5YmlyZC0yMy5jbGVyay5hY2NvdW50cy5kZXYk"
363+
data-clerk-publishable-key="pk_test_Z2VudWluZS1kYXNzaWUtODkuY2xlcmsuYWNjb3VudHMubGNsY2xlcmsuY29tJA"
362364
></script>
363365
<script
364366
type="text/javascript"

packages/clerk-js/src/core/resources/SignIn.ts

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -273,33 +273,27 @@ export class SignIn extends BaseResource implements SignInResource {
273273
clerkVerifyEmailAddressCalledBeforeCreate('SignIn');
274274
}
275275

276-
const params: PrepareFirstFactorParams | PrepareSecondFactorParams = {
276+
const emailLinkParams: EmailLinkConfig = {
277277
strategy: 'email_link',
278-
emailAddressId: emailAddressId,
279-
redirectUrl: redirectUrl,
278+
emailAddressId,
279+
redirectUrl,
280280
};
281+
const isSecondFactor = this.status === 'needs_second_factor';
282+
const verificationKey: 'firstFactorVerification' | 'secondFactorVerification' = isSecondFactor
283+
? 'secondFactorVerification'
284+
: 'firstFactorVerification';
281285

282-
const verification: {
283-
prepareFn: typeof SignIn.prototype.prepareSecondFactor | typeof SignIn.prototype.prepareFirstFactor;
284-
key: 'firstFactorVerification' | 'secondFactorVerification';
285-
} =
286-
this.status === 'needs_second_factor'
287-
? {
288-
prepareFn: this.prepareSecondFactor,
289-
key: 'secondFactorVerification',
290-
}
291-
: {
292-
prepareFn: this.prepareFirstFactor,
293-
key: 'firstFactorVerification',
294-
};
295-
296-
await verification.prepareFn(params);
286+
if (isSecondFactor) {
287+
await this.prepareSecondFactor(emailLinkParams);
288+
} else {
289+
await this.prepareFirstFactor(emailLinkParams);
290+
}
297291

298292
return new Promise((resolve, reject) => {
299293
void run(() => {
300294
return this.reload()
301295
.then(res => {
302-
const status = res[verification.key].status;
296+
const status = res[verificationKey].status;
303297
if (status === 'verified' || status === 'expired') {
304298
stop();
305299
resolve(res);

packages/expo/src/cache/dummy-data/client-resource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export const DUMMY_CLERK_CLIENT_RESOURCE = {
126126
last_active_session_id: null,
127127
cookie_expires_at: null,
128128
last_authentication_strategy: null,
129-
client_trust_state: null,
129+
client_trust_state: 'new',
130130
created_at: new Date().getTime(),
131131
updated_at: new Date().getTime(),
132132
} as unknown as ClientJSONSnapshot;

0 commit comments

Comments
 (0)