Skip to content

Commit

Permalink
Remove login details when cookies deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
HarlJo committed Mar 26, 2024
1 parent f1345d3 commit ddf0687
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/settings/_account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import 'package:pref/pref.dart';

import '../client/authenticate.dart';

class SettingsAccountFragment extends StatelessWidget {
const SettingsAccountFragment({Key? key}) : super(key: key);
class SettingsAccountFragment extends StatefulWidget {
State<SettingsAccountFragment> createState() => _SettingsAccountFragment();
}

class _SettingsAccountFragment extends State<SettingsAccountFragment> {
@override
Widget build(BuildContext context) {
var model = context.read<WebFlowAuthModel>();
Expand Down Expand Up @@ -102,13 +104,6 @@ class SettingsAccountFragment extends StatelessWidget {
FilledButton(
onPressed: () async {
await model.DeleteAllCookies();
await model.GetAuthHeader({
'user-agent':
"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.3",
// "Pragma": "no-cache",
"Cache-Control": "no-cache"
// "If-Modified-Since": "Sat, 1 Jan 2000 00:00:00 GMT",
});
},
child: Text(L10n.of(context).login)),
SizedBox(
Expand All @@ -117,13 +112,18 @@ class SettingsAccountFragment extends StatelessWidget {
OutlinedButton(
onPressed: () async {
await model.DeleteAllCookies();
model.prefs.set(optionLoginNameTwitterAcc, "");
model.prefs.set(optionPasswordTwitterAcc, "");
model.prefs.set(optionEmailTwitterAcc, "");
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
L10n.of(context).twitterCookiesDeleted,
),
),
);

Navigator.pop(context);
},
child: Text(L10n.of(context).DeleteTwitterCookies))
],
Expand Down

0 comments on commit ddf0687

Please sign in to comment.