-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDK-4001] Logout for web platform (#223)
- Loading branch information
1 parent
dc1b2dc
commit 7e3ce1b
Showing
13 changed files
with
139 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
auth0_flutter/lib/src/web/extensions/logout_options.extension.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import '../../../auth0_flutter_web.dart'; | ||
import '../js_interop.dart' as interop; | ||
import '../js_interop_utils.dart'; | ||
|
||
extension LogoutOptionsExtension on LogoutOptions { | ||
interop.LogoutOptions toClientLogoutOptions() => interop.LogoutOptions( | ||
logoutParams: JsInteropUtils.stripNulls( | ||
interop.LogoutParams(federated: federated, returnTo: returnTo))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'dart:js_util'; | ||
|
||
class JsInteropUtils { | ||
/// Rebuilds the input object, omitting values that are null | ||
static T stripNulls<T extends Object>(final T obj) { | ||
final keys = objectKeys(obj); | ||
final output = newObject<Object>(); | ||
|
||
for (var i = 0; i < keys.length; i++) { | ||
final key = keys[i] as String; | ||
final value = getProperty(obj, key) as dynamic; | ||
|
||
if (value != null) { | ||
setProperty(output, key, value); | ||
} | ||
} | ||
|
||
return output as T; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
auth0_flutter_platform_interface/lib/src/web/logout_options.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class LogoutOptions { | ||
final String? returnTo; | ||
final bool? federated; | ||
|
||
LogoutOptions({this.returnTo, this.federated}); | ||
} |