Compare commits

..

No commits in common. "a1e5a1092bcdfc88348c1c9c8ed3a5e8a642b9d9" and "521d01fb1df0046a7d84d5b148f562842c3138f1" have entirely different histories.

2 changed files with 5 additions and 10 deletions

View file

@ -1,5 +1,5 @@
name: "Password storage"
sourceurl: https://git.frostfs.info/Web3N3/neowolves
safemethods: ["checkUser", "getUser"]
safemethods: ["checkUser"]
supportedstandards: []
events: []

View file

@ -16,19 +16,14 @@ func CreateUser(login string, password interop.Hash256) {
}
func CheckUser(login string, givenPassword interop.Hash256) {
password := GetUser(login)
if !password.Equals(givenPassword) {
panic("Password hashes does not match")
}
}
func GetUser(login string) interop.Hash256 {
ctx := storage.GetReadOnlyContext()
password := storage.Get(ctx, login).(interop.Hash256)
if password == nil {
panic("The user does not exist")
panic("This user does not exist")
}
if !password.Equals(givenPassword) {
panic("Password hashes does not match")
}
return password
}
func DeleteUser(login string) {