mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Patch up oauth implementation (#560)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class AddForeignKeysToOauthAccess < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_foreign_key :oauth_access_grants, :users, column: :resource_owner_id
|
||||
add_foreign_key :oauth_access_tokens, :users, column: :resource_owner_id
|
||||
end
|
||||
end
|
||||
4
db/schema.rb
generated
4
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_08_21_021751) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_10_03_161836) do
|
||||
create_schema "pganalyze"
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
@@ -584,7 +584,9 @@ ActiveRecord::Schema[8.0].define(version: 2025_08_21_021751) do
|
||||
add_foreign_key "leaderboard_entries", "users"
|
||||
add_foreign_key "mailing_addresses", "users"
|
||||
add_foreign_key "oauth_access_grants", "oauth_applications", column: "application_id"
|
||||
add_foreign_key "oauth_access_grants", "users", column: "resource_owner_id"
|
||||
add_foreign_key "oauth_access_tokens", "oauth_applications", column: "application_id"
|
||||
add_foreign_key "oauth_access_tokens", "users", column: "resource_owner_id"
|
||||
add_foreign_key "physical_mails", "users"
|
||||
add_foreign_key "project_repo_mappings", "repositories"
|
||||
add_foreign_key "project_repo_mappings", "users"
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
|
||||
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
|
||||
|
||||
Doorkeeper::Application.find_or_create_by(
|
||||
name: "Hackatime Desktop",
|
||||
redirect_uri: "hackatime://auth/callback",
|
||||
uid: "BPr5VekIV-xuQ2ZhmxbGaahJ3XVd7gM83pql-HYGYxQ",
|
||||
scopes: [ "profile" ],
|
||||
confidential: false,
|
||||
)
|
||||
|
||||
# Only seed test data in development environment
|
||||
if Rails.env.development?
|
||||
# Creating test user
|
||||
|
||||
Reference in New Issue
Block a user