1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

feat(server): mobile oauth with custom scheme redirect uri (#1204)

* feat(server): support providers without support for custom schemas

* chore: unit tests

* chore: test mobile override

* chore: add details to the docs
This commit is contained in:
Jason Rasmussen
2022-12-29 15:47:30 -05:00
committed by GitHub
parent 0b65bb7e9a
commit 6974d4068b
22 changed files with 459 additions and 188 deletions

View File

@ -20,6 +20,8 @@ class SystemConfigOAuthDto {
required this.scope,
required this.buttonText,
required this.autoRegister,
required this.mobileOverrideEnabled,
required this.mobileRedirectUri,
});
bool enabled;
@ -36,6 +38,10 @@ class SystemConfigOAuthDto {
bool autoRegister;
bool mobileOverrideEnabled;
String mobileRedirectUri;
@override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigOAuthDto &&
other.enabled == enabled &&
@ -44,7 +50,9 @@ class SystemConfigOAuthDto {
other.clientSecret == clientSecret &&
other.scope == scope &&
other.buttonText == buttonText &&
other.autoRegister == autoRegister;
other.autoRegister == autoRegister &&
other.mobileOverrideEnabled == mobileOverrideEnabled &&
other.mobileRedirectUri == mobileRedirectUri;
@override
int get hashCode =>
@ -55,10 +63,12 @@ class SystemConfigOAuthDto {
(clientSecret.hashCode) +
(scope.hashCode) +
(buttonText.hashCode) +
(autoRegister.hashCode);
(autoRegister.hashCode) +
(mobileOverrideEnabled.hashCode) +
(mobileRedirectUri.hashCode);
@override
String toString() => 'SystemConfigOAuthDto[enabled=$enabled, issuerUrl=$issuerUrl, clientId=$clientId, clientSecret=$clientSecret, scope=$scope, buttonText=$buttonText, autoRegister=$autoRegister]';
String toString() => 'SystemConfigOAuthDto[enabled=$enabled, issuerUrl=$issuerUrl, clientId=$clientId, clientSecret=$clientSecret, scope=$scope, buttonText=$buttonText, autoRegister=$autoRegister, mobileOverrideEnabled=$mobileOverrideEnabled, mobileRedirectUri=$mobileRedirectUri]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
@ -69,6 +79,8 @@ class SystemConfigOAuthDto {
_json[r'scope'] = scope;
_json[r'buttonText'] = buttonText;
_json[r'autoRegister'] = autoRegister;
_json[r'mobileOverrideEnabled'] = mobileOverrideEnabled;
_json[r'mobileRedirectUri'] = mobileRedirectUri;
return _json;
}
@ -98,6 +110,8 @@ class SystemConfigOAuthDto {
scope: mapValueOfType<String>(json, r'scope')!,
buttonText: mapValueOfType<String>(json, r'buttonText')!,
autoRegister: mapValueOfType<bool>(json, r'autoRegister')!,
mobileOverrideEnabled: mapValueOfType<bool>(json, r'mobileOverrideEnabled')!,
mobileRedirectUri: mapValueOfType<String>(json, r'mobileRedirectUri')!,
);
}
return null;
@ -154,6 +168,8 @@ class SystemConfigOAuthDto {
'scope',
'buttonText',
'autoRegister',
'mobileOverrideEnabled',
'mobileRedirectUri',
};
}