forked from PalisadoesFoundation/talawa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 69e6513 Author: Shaik Azad <120930148+Azad99-9@users.noreply.github.com> Date: Sun Feb 11 20:17:19 2024 +0530 Created Session Management. (PalisadoesFoundation#2362) * feat: efficient session management * chore: run check ignore * Revert "chore: run check ignore" This reverts commit be7e49f. * chore fix: run check ignore * feat: added new package fake_async * chore: fixed codecov drop * Update README.md * Deprecate Google Maps Integration (PalisadoesFoundation#2363) * Post comments were invisible in Individual Post Page with Image (PalisadoesFoundation#2350) * Fixed Comment * Fixed Comment * Fixed Comment * Fixed Comment * Fixed Comment * Bump syncfusion_flutter_datepicker from 24.1.47 to 24.2.3 (PalisadoesFoundation#2365) Bumps [syncfusion_flutter_datepicker](https://github.com/syncfusion/flutter-widgets/tree/master/packages) from 24.1.47 to 24.2.3. - [Release notes](https://github.com/syncfusion/flutter-widgets/releases) - [Commits](https://github.com/syncfusion/flutter-widgets/commits/HEAD/packages) --- updated-dependencies: - dependency-name: syncfusion_flutter_datepicker dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syncfusion_flutter_calendar from 24.1.45 to 24.2.3 (PalisadoesFoundation#2367) Bumps [syncfusion_flutter_calendar](https://github.com/syncfusion/flutter-widgets/tree/master/packages) from 24.1.45 to 24.2.3. - [Release notes](https://github.com/syncfusion/flutter-widgets/releases) - [Commits](https://github.com/syncfusion/flutter-widgets/commits/HEAD/packages) --- updated-dependencies: - dependency-name: syncfusion_flutter_calendar dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fixed requested changes * pulled latest upstream --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Peter Harrison <16875803+palisadoes@users.noreply.github.com> Co-authored-by: Parag Gupta <103507835+Dante291@users.noreply.github.com> Co-authored-by: Shivam Gupta <shivamggupta2604@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 1110aef Author: Crystian I <60124535+Cioppolo14@users.noreply.github.com> Date: Tue Feb 6 21:38:27 2024 -0500 Update pull-request-target.yml commit 10d58db Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Feb 5 02:40:39 2024 -0800 Bump syncfusion_flutter_calendar from 24.1.45 to 24.2.3 (PalisadoesFoundation#2367) Bumps [syncfusion_flutter_calendar](https://github.com/syncfusion/flutter-widgets/tree/master/packages) from 24.1.45 to 24.2.3. - [Release notes](https://github.com/syncfusion/flutter-widgets/releases) - [Commits](https://github.com/syncfusion/flutter-widgets/commits/HEAD/packages) --- updated-dependencies: - dependency-name: syncfusion_flutter_calendar dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 7bfbaef Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Feb 5 02:04:46 2024 -0800 Bump syncfusion_flutter_datepicker from 24.1.47 to 24.2.3 (PalisadoesFoundation#2365) Bumps [syncfusion_flutter_datepicker](https://github.com/syncfusion/flutter-widgets/tree/master/packages) from 24.1.47 to 24.2.3. - [Release notes](https://github.com/syncfusion/flutter-widgets/releases) - [Commits](https://github.com/syncfusion/flutter-widgets/commits/HEAD/packages) --- updated-dependencies: - dependency-name: syncfusion_flutter_datepicker dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 38682c8 Author: Shivam Gupta <shivamggupta2604@gmail.com> Date: Sun Feb 4 01:16:07 2024 +0530 Post comments were invisible in Individual Post Page with Image (PalisadoesFoundation#2350) * Fixed Comment * Fixed Comment * Fixed Comment * Fixed Comment * Fixed Comment
- Loading branch information
Showing
28 changed files
with
485 additions
and
111 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:talawa/locator.dart'; | ||
|
||
/// Manages user sessions and periodically refreshes access tokens. | ||
class SessionManager { | ||
SessionManager() { | ||
initializeSessionRefresher(); | ||
} | ||
|
||
/// returns refresh interval of Session Manager. | ||
int get refreshInterval => _refreshInterval; | ||
|
||
/// refresh interval in seconds. | ||
static const int _refreshInterval = 600; | ||
|
||
/// Initializes as session refresher. | ||
/// | ||
/// Invokes [refreshSession] periodically at regular | ||
/// refresh intervals. | ||
/// | ||
/// **params**: | ||
/// None | ||
/// | ||
/// **returns**: | ||
/// * `Timer`: refresh timer. | ||
Timer initializeSessionRefresher() { | ||
return Timer.periodic( | ||
const Duration(seconds: _refreshInterval), | ||
(Timer timer) async { | ||
refreshSession(); | ||
}, | ||
); | ||
} | ||
|
||
/// Asynchronously refreshes the user session. | ||
/// | ||
/// **params**: | ||
/// None | ||
/// | ||
/// **returns**: | ||
/// * `Future<bool>`: indicates if session refresh was | ||
/// successful. | ||
Future<bool> refreshSession() async { | ||
if (userConfig.loggedIn && userConfig.currentUser.refreshToken != null) { | ||
final refreshed = await databaseFunctions | ||
.refreshAccessToken(userConfig.currentUser.refreshToken!); | ||
return refreshed; | ||
} | ||
return false; | ||
} | ||
} |
Oops, something went wrong.