stop deleting key-increment repeatedly
This commit is contained in:
parent
aa00d61ea4
commit
78f27e5835
@ -36,4 +36,7 @@ make_migrations {
|
|||||||
|
|
||||||
[1524605427]: =>
|
[1524605427]: =>
|
||||||
add_column "api_keys", "id", types.serial primary_key: true
|
add_column "api_keys", "id", types.serial primary_key: true
|
||||||
|
|
||||||
|
[1524607145]: =>
|
||||||
|
settings.set "simplex.key-increment", 100 -- I had been accidentally deleting this key over and over again
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ class APIKeys extends Model
|
|||||||
values.key = encode_base64 bcrypt.digest "#{settings["simplex.key-increment"]}#{user.name}#{user.digest}", settings["users.bcrypt-digest-rounds"]
|
values.key = encode_base64 bcrypt.digest "#{settings["simplex.key-increment"]}#{user.name}#{user.digest}", settings["users.bcrypt-digest-rounds"]
|
||||||
settings["simplex.key-increment"] += 1
|
settings["simplex.key-increment"] += 1
|
||||||
unless APIKeys\find key: values.key
|
unless APIKeys\find key: values.key
|
||||||
settings.set "simplex.key-increment"
|
settings.save "simplex.key-increment"
|
||||||
break
|
break
|
||||||
|
|
||||||
super values, opts
|
super values, opts
|
||||||
|
Loading…
Reference in New Issue
Block a user