forked from Qortal/qortal
Allow a new API key to be generated if the existing apikey.txt file has been deleted
This commit is contained in:
parent
b6db5aa2d3
commit
db8e35cc13
2
.gitignore
vendored
2
.gitignore
vendored
@ -30,4 +30,4 @@
|
||||
/tmp
|
||||
/data*
|
||||
/src/test/resources/arbitrary/*/.qortal/cache
|
||||
apikey
|
||||
apikey.txt
|
||||
|
@ -86,6 +86,10 @@ public class ApiKey {
|
||||
return (this.apiKey != null);
|
||||
}
|
||||
|
||||
public boolean exists() {
|
||||
return this.getFilePath().toFile().exists();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.apiKey;
|
||||
|
@ -735,7 +735,7 @@ public class AdminResource {
|
||||
ApiKey apiKey = Security.getApiKey(request);
|
||||
|
||||
// If the API key is already generated, we need to authenticate this request
|
||||
if (apiKey.generated()) {
|
||||
if (apiKey.generated() && apiKey.exists()) {
|
||||
Security.checkApiCallAllowed(request);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user