Skip to content

Commit f4cca24

Browse files
SinaSeylaniSina Seylani
andauthored
Edit passkey fix (#99)
* tests are updated for token store * inline docs updated * language added to func - otp and magiclink * tests updated * tests updated * ios code updated * Comments added for social class * Comments added for social class * Comments added for social class * current user updated * Passageswift updated * editPasskeyName updated * Web tests pipeline update * docs update - workflow version update * docs update --------- Co-authored-by: Sina Seylani <sina.seylani@agilebits.com>
1 parent 6d085ba commit f4cca24

File tree

6 files changed

+14
-18
lines changed

6 files changed

+14
-18
lines changed

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Set up Google Chrome and ChromeDriver
4444
uses: browser-actions/setup-chrome@v1
4545
with:
46-
chrome-version: 131
46+
chrome-version: 137
4747
install-chromedriver: true
4848
install-dependencies: false
4949

lib/passage_current_user.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class PassageCurrentUser {
1212
///
1313
/// Returns:
1414
/// A `Future<CurrentUser>` representing the current Passage user's info,
15-
/// or `null` if the current Passage user's authentication token could not be validated.
1615
Future<CurrentUser> userInfo() {
1716
return PassageFlutterPlatform.instance.getCurrentUser();
1817
}
@@ -97,7 +96,7 @@ class PassageCurrentUser {
9796
/// Retrieves a list of WebAuthn passkeys associated with the authenticated user.
9897
///
9998
/// Returns:
100-
/// A `Future<List<Passkey>>` containing all WebAuthn passkeys for the current user.
99+
/// A `Future<List<Passkey>>?` containing all WebAuthn passkeys for the current user.
101100
///
102101
/// Throws:
103102
/// `PassageError` if an error occurs during the retrieval process.
@@ -122,7 +121,7 @@ Future<UserSocialConnections?> socialConnections() {
122121
/// - `socialConnectionType`: The type of social connection to delete.
123122
///
124123
/// Returns:
125-
/// A `Future<void>` that resolves when the social connection is deleted.
124+
/// A `Future<void>?` that resolves when the social connection is deleted.
126125
///
127126
/// Throws:
128127
/// `PassageError` if an error occurs during the deletion process.
@@ -133,7 +132,7 @@ Future<void>? deleteSocialConnection(SocialConnection socialConnectionType) {
133132
/// Fetches the metadata associated with the authenticated user.
134133
///
135134
/// Returns:
136-
/// A `Future<Metadata>` containing the metadata for the user.
135+
/// A `Future<Metadata?>` containing the metadata for the user.
137136
///
138137
/// Throws:
139138
/// `PassageError` if an error occurs during the retrieval process.
@@ -147,7 +146,7 @@ Future<Metadata?> metadata() {
147146
/// - `metaData`: The new metadata to update for the user.
148147
///
149148
/// Returns:
150-
/// A `Future<CurrentUser>` containing the updated information of the user.
149+
/// A `Future<CurrentUser>?` containing the updated information of the user.
151150
///
152151
/// Throws:
153152
/// `PassageError` if an error occurs during the update process.
@@ -158,7 +157,7 @@ Future<CurrentUser>? updateMetadata(Metadata metaData) {
158157
/// Signs out the current user, clearing local tokens and logging out of the system.
159158
///
160159
/// Returns:
161-
/// A `Future<void>` that resolves when the user is successfully signed out.
160+
/// A `Future<void>?` that resolves when the user is successfully signed out.
162161
///
163162
/// Throws:
164163
/// `PassageError` if an error occurs during the sign-out process.

lib/passage_flutter_web.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,7 @@ class PassageFlutterWeb extends PassageFlutterPlatform {
360360
Future<model.Passkey> editPasskeyName(
361361
String passkeyId, String newPasskeyName) async {
362362
try {
363-
final objFromMap = js_util.jsify({'friendly_name': newPasskeyName});
364-
final resultPromise =
365-
passage.currentUser.editPasskey(passkeyId, objFromMap);
363+
final resultPromise = passage.currentUser.editPasskey(passkeyId, newPasskeyName);
366364
final jsObject = await js_util.promiseToFuture(resultPromise);
367365
return model.Passkey.fromJson(jsObject);
368366
} catch (e) {

lib/passage_magliclink.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class PassageMagiclink {
1111
/// - `language`: The language code for the magic link.
1212
///
1313
/// Returns:
14-
/// A `Future<String>` that returns a magic link ID used to check the status
14+
/// A `Future<MagicLink>` that returns a magic link ID used to check the status
1515
/// of the magic link with `getMagicLinkStatus`.
1616
///
1717
/// Throws:
@@ -62,9 +62,8 @@ class PassageMagiclink {
6262
/// - `id`: The magic link ID.
6363
///
6464
/// Returns:
65-
/// A `Future<AuthResult?>` object that includes a redirect URL and saves the
66-
/// authorization token and (optional) refresh token securely to the device, or `null` if
67-
/// the magic link has not been verified.
65+
/// A `Future<AuthResult>` object that includes a redirect URL and saves the
66+
/// authorization token and (optional) refresh token securely to the device
6867
///
6968
/// Throws:
7069
/// `PassageError`

lib/passage_otp.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class PassageOneTimePasscode {
1111
/// - `language`: The language code for the one time passcode.
1212
///
1313
/// Returns:
14-
/// A `Future<String>` that returns a one-time passcode ID used to activate
14+
/// A `Future<OneTimePasscode>` that returns a one-time passcode ID used to activate
1515
/// the passcode in `oneTimePasscodeActivate`.
1616
///
1717
/// Throws:
@@ -30,7 +30,7 @@ class PassageOneTimePasscode {
3030
/// - `language`: The language code for the one time passcode.
3131
///
3232
/// Returns:
33-
/// A `Future<String>` that returns a one-time passcode ID used to activate
33+
/// A `Future<OneTimePasscode>` that returns a one-time passcode ID used to activate
3434
/// the passcode in `oneTimePasscodeActivate`.
3535
///
3636
/// Throws:

lib/passage_token_store.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class PassageTokenStore {
88
/// If the stored auth token is invalid, this method will use the refresh token to get and save a new auth token.
99
///
1010
/// Returns:
11-
/// A `Future<String?>` representing the user's auth token,
11+
/// A `Future<String>` representing the user's auth token,
1212
/// Throws:
1313
/// `PassageError`
1414
Future<String> getValidAuthToken() {
@@ -27,7 +27,7 @@ class PassageTokenStore {
2727
/// Refreshes, retrieves, and saves a new authToken for the currently authenticated user using their refresh token.
2828
///
2929
/// Returns:
30-
/// A `Future<String>` representing the new auth token.
30+
/// A `Future<AuthResult>` representing the new auth token.
3131
///
3232
/// Throws:
3333
/// `PassageError`

0 commit comments

Comments
 (0)