TF-571 Check OIDC is available

This commit is contained in:
dab246
2022-05-20 12:38:31 +07:00
committed by Dat H. Pham
parent c5aa9f7d69
commit 239234f836
29 changed files with 625 additions and 55 deletions
@@ -0,0 +1,29 @@
import 'package:core/core.dart';
import 'package:tmail_ui_user/features/login/data/network/endpoint.dart';
extension ServicePathExtension on ServicePath {
String generateEndpointPath() {
return path;
}
ServicePath generateOIDCPath(Uri baseUrl) {
return ServicePath(baseUrl.origin + Endpoint.oidc + path);
}
ServicePath withQueryParameters(List<QueryParameter> queryParameters) {
if (queryParameters.isEmpty) {
return this;
}
return ServicePath('$path?${queryParameters
.map((query) => '${query.queryName}=${query.queryValue}').join('&')}');
}
ServicePath withPathParameter([String? pathParameter]) {
if (pathParameter == null || pathParameter.isEmpty) {
return this;
}
return ServicePath('$path/$pathParameter');
}
}