response_type: params["response_type"],
client_id: params["client_id"],
scope: params["scope"],
- redirect_uri: params["redirect_uri"]
+ redirect_uri: params["redirect_uri"],
+ state: params["state"]
}
end
}
else
url = "#{redirect_uri}?code=#{auth.token}"
+ url = if params["state"] do
+ url <> "&state=#{params["state"]}"
+ else
+ url
+ end
redirect(conn, external: url)
end
end
<%= hidden_input f, :response_type, value: @response_type %>
<%= hidden_input f, :redirect_uri, value: @redirect_uri %>
<%= hidden_input f, :scope, value: @scope %>
+<%= hidden_input f, :state, value: @state%>
<%= submit "Authorize" %>
<% end %>