Skip to content

Commit

Permalink
Merge pull request #112 from geteduroam/feature/GETEDUROAM-74
Browse files Browse the repository at this point in the history
GETEDUROAM-74: Handle webview profile type
  • Loading branch information
dzolnai authored Oct 15, 2024
2 parents 6649197 + 0a861cb commit 0a35162
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ data class Profile(
val redirect: String? = null,
val type: Type = Profile.Type.unknown,
@SerialName("letswifi_endpoint")
val letswifiEndpoint: String? = null
val letswifiEndpoint: String? = null,
@SerialName("webview_endpoint")
val webviewEndpoint: String? = null
) : Parcelable {

@Serializable
Expand All @@ -31,6 +33,8 @@ data class Profile(
letswifi,
@SerialName("eap-config")
eapConfig,
@SerialName("webview")
webview,
unknown
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ class SelectProfileViewModel @Inject constructor(
inProgress = false,
openUrlInBrowser = profile.redirect
)
} else if (profile.type == Profile.Type.webview && !profile.webviewEndpoint.isNullOrEmpty()) {
uiState = uiState.copy(
inProgress = false,
openUrlInBrowser = profile.webviewEndpoint
)
} else {
Timber.w("Missing EAP endpoint in profile configuration. Cannot continue with selected profile.")
uiState = uiState.copy(
Expand Down

0 comments on commit 0a35162

Please sign in to comment.