Add very basic oauth and mastodon api support.

This commit is contained in:
Roger Braun 2017-09-06 19:06:25 +02:00
commit 2a298d70f9
16 changed files with 286 additions and 0 deletions

View file

@ -0,0 +1,2 @@
<h1>Successfully authorized</h1>
<h2>Token code is <%= @auth.token %></h2>

View file

@ -0,0 +1,14 @@
<h2>OAuth Authorization</h2>
<%= form_for @conn, o_auth_path(@conn, :authorize), [as: "authorization"], fn f -> %>
<%= label f, :name, "Name" %>
<%= text_input f, :name %>
<br>
<%= label f, :password, "Password" %>
<%= password_input f, :password %>
<br>
<%= hidden_input f, :client_id, value: @client_id %>
<%= hidden_input f, :response_type, value: @response_type %>
<%= hidden_input f, :redirect_uri, value: @redirect_uri %>
<%= hidden_input f, :scope, value: @scope %>
<%= submit "Authorize" %>
<% end %>