Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: return void instead of boolean #212

Merged
merged 1 commit into from
Dec 30, 2024
Merged
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
16 changes: 6 additions & 10 deletions src/classes/User/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ export class User extends PassageBase {
* Delete a user using their user ID.
*
* @param {string} userId The Passage user ID used to delete the corresponding user.
* @return {Promise<boolean>}
* @return {Promise<void>}
*/
public async delete(userId: string): Promise<boolean> {
public async delete(userId: string): Promise<void> {
if (!userId) {
throw new Error('userId is required.');
}
Expand All @@ -184,7 +184,6 @@ export class User extends PassageBase {
userId,
appId: this.config.appId,
});
return true;
} catch (err) {
throw await this.parseError(err);
}
Expand Down Expand Up @@ -218,9 +217,9 @@ export class User extends PassageBase {
*
* @param {string} userId The Passage user ID
* @param {string} deviceId The Passage user's device ID
* @return {Promise<boolean>}
* @return {Promise<void>}
*/
public async revokeDevice(userId: string, deviceId: string): Promise<boolean> {
public async revokeDevice(userId: string, deviceId: string): Promise<void> {
if (!userId) {
throw new Error('userId is required.');
}
Expand All @@ -235,8 +234,6 @@ export class User extends PassageBase {
deviceId,
appId: this.config.appId,
});

return true;
} catch (err) {
throw await this.parseError(err);
}
Expand All @@ -246,9 +243,9 @@ export class User extends PassageBase {
* Revokes all of a user's Refresh Tokens using their User ID.
*
* @param {string} userId The Passage user ID
* @return {Promise<boolean>}
* @return {Promise<void>}
*/
public async revokeRefreshTokens(userId: string): Promise<boolean> {
public async revokeRefreshTokens(userId: string): Promise<void> {
if (!userId) {
throw new Error('userId is required.');
}
Expand All @@ -258,7 +255,6 @@ export class User extends PassageBase {
userId,
appId: this.config.appId,
});
return true;
} catch (err) {
throw await this.parseError(err);
}
Expand Down
Loading