Implement both tokens and rate limiting to API
Closes #141, but still needs better UI on failure
This commit is contained in:
@@ -42,6 +42,26 @@
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
API Key
|
||||
</td>
|
||||
<td class="apiKey">
|
||||
{{#if apiKey}}
|
||||
{{#unless showApiKey}}
|
||||
<paper-button class="showApiKey">
|
||||
Show
|
||||
</paper-button>
|
||||
{{else}}
|
||||
{{apiKey}}
|
||||
{{/unless}}
|
||||
{{else}}
|
||||
<paper-button class="generateMyApiKey">
|
||||
Generate
|
||||
</paper-button>
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="max-width: 250px">
|
||||
{{> atForm state="signIn"}}
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
Template.profile.onCreated(function(){
|
||||
this.showApiKey = new ReactiveVar(false);
|
||||
});
|
||||
|
||||
Template.profile.helpers({
|
||||
profileName: function() {
|
||||
var user = Meteor.user();
|
||||
return user.profile && user.profile.username ||
|
||||
user.username ||
|
||||
"Tap to set username";
|
||||
}
|
||||
},
|
||||
showApiKey: function(){
|
||||
return Template.instance().showApiKey.get();
|
||||
},
|
||||
});
|
||||
|
||||
Template.profile.events({
|
||||
@@ -25,4 +32,11 @@ Template.profile.events({
|
||||
data: {},
|
||||
});
|
||||
},
|
||||
"click .showApiKey": function(event, instance){
|
||||
instance.showApiKey.set(!instance.showApiKey.get());
|
||||
},
|
||||
"click .generateMyApiKey": function(event, instance){
|
||||
Meteor.call("generateMyApiKey");
|
||||
instance.showApiKey.set(true);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user