-
Notifications
You must be signed in to change notification settings - Fork 16
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
Bug fix/cannot login when token is deleted #950
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6cc7c54
Handled exception thrown by retry_interceptor
KhaledNjim 0aed774
removing permanent token from retry_interceptor when 3 retries fail
KhaledNjim 0a8e30c
added handling depanding on buisness error code
KhaledNjim 495c112
added usecase to remove token locally
KhaledNjim 0f8d0be
LA-1238 removed comments
KhaledNjim b140abc
LA-1238 replaced some hard coded values
KhaledNjim 25c768f
Update data/lib/src/network/config/retry_authentication_interceptors.…
KhaledNjim 63e3f5b
LA-1238 code formatting
KhaledNjim 253539c
Update domain/lib/src/usecases/authentication/get_authorized_user_int…
KhaledNjim 20aa483
LA-1238 removed hardcoded error code value
KhaledNjim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
60 changes: 60 additions & 0 deletions
60
domain/lib/src/usecases/authentication/remove_permanent_token_interactor.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,60 @@ | ||
// LinShare is an open source filesharing software, part of the LinPKI software | ||
// suite, developed by Linagora. | ||
// | ||
// Copyright (C) 2020 LINAGORA | ||
// | ||
// This program is free software: you can redistribute it and/or modify it under the | ||
// terms of the GNU Affero General Public License as published by the Free Software | ||
// Foundation, either version 3 of the License, or (at your option) any later version, | ||
// provided you comply with the Additional Terms applicable for LinShare software by | ||
// Linagora pursuant to Section 7 of the GNU Affero General Public License, | ||
// subsections (b), (c), and (e), pursuant to which you must notably (i) retain the | ||
// display in the interface of the “LinShare™” trademark/logo, the "Libre & Free" mention, | ||
// the words “You are using the Free and Open Source version of LinShare™, powered by | ||
// Linagora © 2009–2020. Contribute to Linshare R&D by subscribing to an Enterprise | ||
// offer!”. You must also retain the latter notice in all asynchronous messages such as | ||
// e-mails sent with the Program, (ii) retain all hypertext links between LinShare and | ||
// http://www.linshare.org, between linagora.com and Linagora, and (iii) refrain from | ||
// infringing Linagora intellectual property rights over its trademarks and commercial | ||
// brands. Other Additional Terms apply, see | ||
// <http://www.linshare.org/licenses/LinShare-License_AfferoGPL-v3.pdf> | ||
// for more details. | ||
// This program is distributed in the hope that it will be useful, but WITHOUT ANY | ||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for | ||
// more details. | ||
// You should have received a copy of the GNU Affero General Public License and its | ||
// applicable Additional Terms for LinShare along with this program. If not, see | ||
// <http://www.gnu.org/licenses/> for the GNU Affero General Public License version | ||
// 3 and <http://www.linshare.org/licenses/LinShare-License_AfferoGPL-v3.pdf> for | ||
// the Additional Terms applicable to LinShare software. | ||
|
||
import 'dart:developer' as developer; | ||
|
||
import 'package:dartz/dartz.dart'; | ||
import 'package:domain/domain.dart'; | ||
|
||
import 'logout_view_state.dart'; | ||
|
||
class RemovePermanentTokenInteractor { | ||
final TokenRepository tokenRepository; | ||
final CredentialRepository credentialRepository; | ||
|
||
RemovePermanentTokenInteractor( | ||
this.tokenRepository, | ||
this.credentialRepository | ||
); | ||
|
||
Future<Either<Failure, Success>> execute() async { | ||
try { | ||
Future.sync(() async { | ||
await tokenRepository.removeToken(); | ||
developer.log('execute(): deleteToken', name: 'DeletePermanentTokenInteractor'); | ||
await credentialRepository.removeBaseUrl(); | ||
}); | ||
return Right(LogoutViewState()); | ||
} catch (exception) { | ||
return Left(LogoutFailure(exception)); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please dont use magic number. constant 1000 in value