0
0
Fork 0

The frontend will now be an OAuth app, auto-authorized. The frontend will use an access token for API requests

Adding better errors for the API controllers, posting a simple status works from the frontend now
This commit is contained in:
Eugen Rochko 2016-08-26 19:12:19 +02:00
parent 44e57f64dd
commit 92afd29650
16 changed files with 127 additions and 25 deletions

View file

@ -0,0 +1,5 @@
class AddSuperappToOauthApplications < ActiveRecord::Migration[5.0]
def change
add_column :oauth_applications, :superapp, :boolean, default: false, null: false
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160325130944) do
ActiveRecord::Schema.define(version: 20160826155805) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -94,15 +94,16 @@ ActiveRecord::Schema.define(version: 20160325130944) do
end
create_table "oauth_applications", force: :cascade do |t|
t.string "name", null: false
t.string "uid", null: false
t.string "secret", null: false
t.text "redirect_uri", null: false
t.string "scopes", default: "", null: false
t.string "name", null: false
t.string "uid", null: false
t.string "secret", null: false
t.text "redirect_uri", null: false
t.string "scopes", default: "", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "owner_id"
t.string "owner_type"
t.boolean "superapp", default: false, null: false
t.index ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree
t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree
end

View file

@ -1,7 +1,2 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
web_app = Doorkeeper::Application.new(name: 'Web', superapp: true, redirect_uri: Doorkeeper.configuration.native_redirect_uri)
web_app.save(validate: false)