Fix password hashing on login
This commit is contained in:
parent
a0f0e95043
commit
1bd2112696
2 changed files with 7 additions and 3 deletions
|
@ -1,6 +1,5 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:libac_flutter/utils/Hashing.dart';
|
||||
import 'package:zontreck/pages/OpenSim.dart';
|
||||
|
||||
import 'Settings.dart';
|
||||
|
@ -271,7 +270,7 @@ class C2SLoginPacket implements IPacket {
|
|||
"first": first,
|
||||
"last": last,
|
||||
"type": getType(),
|
||||
"password": Hashing.md5Hash(password)
|
||||
"password": password
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:libac_flutter/utils/Hashing.dart';
|
||||
import 'package:zontreck/Constants.dart';
|
||||
import 'package:zontreck/Packets.dart';
|
||||
import 'package:zontreck/Settings.dart';
|
||||
|
@ -57,7 +58,7 @@ class LoginAccountState extends State<LoginAccountPage> {
|
|||
C2SLoginPacket packet = C2SLoginPacket(
|
||||
first: first.text,
|
||||
last: last.text,
|
||||
password: pass.text);
|
||||
password: Hashing.md5Hash(pass.text));
|
||||
|
||||
var response = await settings.sendPacketToEndpoint(
|
||||
APIEndpoint.Login, packet) as S2CLoginResponsePacket;
|
||||
|
@ -69,6 +70,10 @@ class LoginAccountState extends State<LoginAccountPage> {
|
|||
|
||||
settings.loggedIn = true;
|
||||
settings.currentUser = response.user;
|
||||
} else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
"Error while logging in: ${response.reason}")));
|
||||
}
|
||||
},
|
||||
child: Text("Login"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue