Skip to content

Commit

Permalink
added totpuri check
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-74 committed Jul 15, 2024
1 parent a918f78 commit 4a85555
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/lib/serverconnectpage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:ffi';
import 'dart:io';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';
import 'package:http/http.dart' as http;
import 'package:http/io_client.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
Expand Down Expand Up @@ -63,6 +64,10 @@ class _RegistrationpageState extends State<Serverconnectpage> {
var body = json.decode(response.body);
String totpUri = body['auth'];

if(!totpUri.startsWith('otpauth://totp/')) {
return false;
}

await addServer(serverIP, port, _username!, totpUri);

showDialog(
Expand Down

0 comments on commit 4a85555

Please sign in to comment.