Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/heavy-hornets-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@clerk/clerk-js': patch
'@clerk/types': patch
'@clerk/clerk-expo': patch
---

Improve the UX on Reverification by not requiring the user's current password.

The user has already verified themselves using Reverification, so there is no point to maintain a two level verification in case they would like to change their password. Also, Reverification is a stronger verification factor, as it includes strategies such as email code.
3 changes: 3 additions & 0 deletions packages/clerk-js/src/core/resources/AuthConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { BaseResource } from './internal';
export class AuthConfig extends BaseResource implements AuthConfigResource {
singleSessionMode!: boolean;
claimedAt: Date | null = null;
reverification!: boolean;

public constructor(data: AuthConfigJSON) {
super();
Expand All @@ -15,6 +16,7 @@ export class AuthConfig extends BaseResource implements AuthConfigResource {
protected fromJSON(data: AuthConfigJSON | null): this {
this.singleSessionMode = data ? data.single_session_mode : true;
this.claimedAt = data?.claimed_at ? unixEpochToDate(data.claimed_at) : null;
this.reverification = data ? data.reverification : true;
return this;
}

Expand All @@ -24,6 +26,7 @@ export class AuthConfig extends BaseResource implements AuthConfigResource {
id: this.id || '',
single_session_mode: this.singleSessionMode,
claimed_at: this.claimedAt ? this.claimedAt.getTime() : null,
reverification: this.reverification,
};
}
}
16 changes: 14 additions & 2 deletions packages/clerk-js/src/core/resources/__tests__/Environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ describe('Environment', () => {
const environmentJSON = {
object: 'environment',
id: '',
auth_config: { object: 'auth_config', id: '', single_session_mode: true, claimed_at: null },
auth_config: {
object: 'auth_config',
id: '',
single_session_mode: true,
claimed_at: null,
reverification: true,
},
display_config: {
object: 'display_config',
id: 'display_config_DUMMY_ID',
Expand Down Expand Up @@ -240,7 +246,13 @@ describe('Environment', () => {
const environmentJSON = {
object: 'environment',
id: '',
auth_config: { object: 'auth_config', id: '', single_session_mode: true, claimed_at: null },
auth_config: {
object: 'auth_config',
id: '',
single_session_mode: true,
claimed_at: null,
reverification: true,
},
display_config: {
object: 'display_config',
id: 'display_config_DUMMY_ID',
Expand Down
Loading