lib/generators/rodauth/oauth/templates/app/views/rodauth/oauth_tokens.html.erb in rodauth-oauth-0.7.4 vs lib/generators/rodauth/oauth/templates/app/views/rodauth/oauth_tokens.html.erb in rodauth-oauth-0.8.0

- old
+ new

@@ -1,35 +1,31 @@ -<% oauth_tokens_ds = rodauth.scope.instance_variable_get(:@oauth_tokens) %> -<% tokens_count = oauth_tokens_ds.count %> +<% oauth_tokens = rodauth.scope.instance_variable_get(:@oauth_tokens) %> +<% tokens_count = oauth_tokens.count %> <% if tokens_count.zero? %> <p>No oauth tokens yet!</p> <% else %> <table class="table"> <thead> <tr> - <th scope="col">Token</th> - <th scope="col">Refresh Token</th> - <th scope="col">Expires in</th> - <th scope="col">Revoked at</th> - <th scope="col">Scopes</th> + <th scope="col"><=% rodauth.oauth_applications_name_label %></th> + <th scope="col"><=% rodauth.oauth_tokens_token_label %></th> + <th scope="col"><=% rodauth.oauth_tokens_refresh_token_label %></th> + <th scope="col"><=% rodauth.oauth_tokens_expires_in_label %></th> + <th scope="col"><=% rodauth.oauth_tokens_scopes_label %></th> <th scope="col"><span class="badge badge-pill badge-dark"><%= tokens_count %></span> </tr> </thead> <tbody> - <% oauth_tokens_ds.each do |application| %> + <% oauth_tokens.each do |oauth_token| %> <tr> + <td><%= oauth_token[rodauth.oauth_applications_name_column] %></td> <td><code class="token"><%= oauth_token[rodauth.oauth_tokens_token_column] %></code></td> <td><code class="token"><%= oauth_token[rodauth.oauth_tokens_refresh_token_column] %></code></td> <td><%= oauth_token[rodauth.oauth_tokens_expires_in_column] %></td> - <td><%= oauth_token[rodauth.oauth_tokens_revoked_at_column] %></td> <td><%= oauth_token[rodauth.oauth_tokens_scopes_column] %></td> <td> - <% if !oauth_token[rodauth.oauth_tokens_revoked_at_column] %> - <%= form_tag rodauth.revoke_path, method: :post do %> - <%= hidden_field_tag :token_type_hint, "access_token" %> - <%= hidden_field_tag :token, oauth_token[rodauth.oauth_tokens_token_column] %> - <%= submit_tag "Revoke", class: "btn btn-danger" %> - <% end %> + <%= form_tag rodauth.oauth_token_path(oauth_token[rodauth.oauth_tokens_id_column]), method: :post do %> + <%= submit_tag rodauth.oauth_token_revoke_button, class: "btn btn-danger" %> <% end %> </td> </tr> <% end %> </tbody>