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

Patch/support auth0 spa 1.20 #11

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
55 changes: 34 additions & 21 deletions auth0_flutter_web/lib/src/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class BaseLoginOptions {
external String get scope;
external String get audience;
external String? get connection;
external String? get organization;
external String? get invitation;
external String? get screen_hint;

external factory BaseLoginOptions({
String display,
Expand All @@ -28,7 +31,10 @@ class BaseLoginOptions {
String acr_values,
String scope,
String audience,
String? connection
String? connection,
String? organization,
String? invitation,
String? screen_hint,
});
}

Expand All @@ -37,9 +43,7 @@ class BaseLoginOptions {
class AdvancedOptions {
external String? get defaultScope;

external factory AdvancedOptions({
String? defaultScope
});
external factory AdvancedOptions({String? defaultScope});
}

@JS()
Expand All @@ -57,7 +61,9 @@ class Auth0ClientOptions extends BaseLoginOptions {
external bool get useCookiesForTransactions;
external AdvancedOptions get advancedOptions;
external num get sessionCheckExpiryDays;

external num get httpTimeoutInSeconds;
external bool get useFormData;

external factory Auth0ClientOptions({
String display,
String prompt,
Expand All @@ -80,13 +86,18 @@ class Auth0ClientOptions extends BaseLoginOptions {
bool legacySameSiteCookie,
bool useCookiesForTransactions,
AdvancedOptions advancedOptions,
num sessionCheckExpiryDays
num sessionCheckExpiryDays,
num httpTimeoutInSeconds,
bool useFormData,
String? organization,
String? invitation,
String? screen_hint,
});
}

@JS()
@anonymous
class PopupLoginOptions extends BaseLoginOptions{
class PopupLoginOptions extends BaseLoginOptions {
external factory PopupLoginOptions({
String display,
String prompt,
Expand All @@ -97,25 +108,27 @@ class PopupLoginOptions extends BaseLoginOptions{
String acr_values,
String scope,
String audience,
String? connection
String? connection,
String? organization,
String? invitation,
String? screen_hint,
});
}

@JS()
@anonymous
class GetTokenWithPopupOptions extends PopupLoginOptions {
external factory GetTokenWithPopupOptions({
String display,
String prompt,
Object max_age,
String ui_locales,
String id_token_hint,
String login_hint,
String acr_values,
String scope,
String audience,
String? connection
});
external factory GetTokenWithPopupOptions(
{String display,
String prompt,
Object max_age,
String ui_locales,
String id_token_hint,
String login_hint,
String acr_values,
String scope,
String audience,
String? connection});
}

@JS()
Expand Down Expand Up @@ -154,7 +167,7 @@ class LogoutOptions {

@JS()
@anonymous
class GetUserOptions{
class GetUserOptions {
external String get scope;
external String get audience;

Expand Down
2 changes: 1 addition & 1 deletion example/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>

<script src="https://cdn.auth0.com/js/auth0-spa-js/1.13/auth0-spa-js.production.js"></script>
<script src="https://cdn.auth0.com/js/auth0-spa-js/1.20/auth0-spa-js.production.js"></script>

<title>auth0_web_integration</title>
<link rel="manifest" href="manifest.json">
Expand Down