Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Added improved error handling and Open API generated code #90

Merged
merged 16 commits into from
Jun 27, 2024

Conversation

rickycpadilla
Copy link
Contributor

@rickycpadilla rickycpadilla commented Jun 13, 2024

What's new

Improved error enums

When calling a PassageAuth method, developers can now catch and handle more specific error cases.

OpenAPI generated code

We replaced manually written networking code with auto-generated code using Passage’s OpenAPI auth-api specification.

Added new instance methods

The methods below were available only as static methods, and are now available as instance methods as well.

  • appInfo()
  • newRegisterMagicLink()
  • newLoginMagicLink()
  • newRegisterOneTimePasscode()
  • newLoginOneTimePasscode()
  • getUser()

⚠️ Minor breaking changes

  • Removed deprecated “login” and “register” methods. Use “loginWithPasskey” or “registerWithPasskey” methods instead.
  • Removed previous Error enums in favor of more exhaustive PassageError enums.

Contributor notes

  • Added CONTRIBUTING.md to begin documenting how to contribute to this repo.
  • See CONTRIBUTING.md to learn how to run code generator.

Other related changes

Rewrote integration tests

Previously, integration tests tested the PasageAPIClient class directly. This class has been removed. Now the tests are written against instances of PassageAuth instead.

* refactor(PSG-3976): otp & ml auth methods refactor

* refactor(PSG-3976): refactored passkey methods

* refactor(PSG-3976): remove olde MagicLink struct

* refactor(PSG-3976): removed unused api client code
* refactor(PSG-3976): otp & ml auth methods refactor

* refactor(PSG-3976): refactored passkey methods

* refactor(PSG-3976): remove olde MagicLink struct

* refactor(PSG-3976): removed unused api client code

* refactor: removed `PassageAPIClient`

* refactor: cleaned up unused models
* refactor(PSG-3976): otp & ml auth methods refactor

* refactor(PSG-3976): refactored passkey methods

* refactor(PSG-3976): remove olde MagicLink struct

* refactor(PSG-3976): removed unused api client code

* refactor: removed `PassageAPIClient`

* refactor: cleaned up unused models

* refactor: removed PassageSettings class

* refactor: update app info tests

* refactor: updated get user tests

* refactor: updated otp tests

* refactor: updated magic link tests

* refactor: updated change contact tests

* refactor: updated current user tests

* refactor: update device tests

* refactor: updated session tests

* refactor: updated social auth tests

* refactor: removed outdated unit tests

* refactor: removed unnecessary static test data

* refactor: misc test cleanup

* Update Sources/Passage/PassageAuth.swift

Signed-off-by: Ricky Padilla <[email protected]>

---------

Signed-off-by: Ricky Padilla <[email protected]>
@rickycpadilla rickycpadilla marked this pull request as ready for review June 17, 2024 20:18
@rickycpadilla rickycpadilla requested a review from a team as a code owner June 17, 2024 20:18
@rickycpadilla rickycpadilla marked this pull request as draft June 17, 2024 20:19
@rickycpadilla rickycpadilla marked this pull request as ready for review June 18, 2024 18:24
SinaSeylani
SinaSeylani previously approved these changes Jun 18, 2024
Copy link

Copy link

@SinaSeylani SinaSeylani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!!!

@rickycpadilla rickycpadilla merged commit 857245d into main Jun 27, 2024
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants