Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ログイン方式(ユーザーの紐付け)をUUIDに変更する #218

Open
fukuiretu opened this issue Nov 10, 2015 · 3 comments
Open

Comments

@fukuiretu
Copy link
Member

お上から承認が下りないので...UUID方式に変更

処理フロー
  • クライアントでUUIDを発行する (ref: http://qiita.com/ashdik/items/1ecbcbddf6ae476bd253)
  • 発行したUUIDを signin用のAPIに投げる
  • signin用のAPIはアクセストークンとユーザー情報を返す
  • 以降はこれまでと一緒
以下は別途画面も必要になるので次期リリースで検討
  • UUIDの設計で、引き継ぎはソーシャルアカウント必要
  • UUIDの設計で、引き継ぎはソーシャルアカウント必要というのがダメなら、引き継ぎ発行の仕組みつくる
取り急ぎの作業
@fukuiretu
Copy link
Member Author

before

create_table "users", force: :cascade do |t|
  t.string   "provider",           limit: 255
  t.string   "uid",                limit: 255
  t.string   "oauth_token",        limit: 255
  t.string   "oauth_token_secret", limit: 255
  t.integer  "status",             limit: 4
  t.datetime "created_at",                     null: false
  t.datetime "updated_at",                     null: false
end

add_index "users", ["provider", "uid"], name: "index_users_on_provider_and_uid", unique: true, using: :btree

after

create_table "users", force: :cascade do |t|
  t.integer  "device_type"    limit: 4       null: false,  comment: "1: ios, 2: android"
  t.string    "uuid",                limit: 255   null: false,  comment: "UUID"
  t.integer  "status",             limit: 4       null: false
  t.datetime "created_at",                      null: false
  t.datetime "updated_at",                     null: false
end

add_index "users", ["uuid"], name: "index_users_on_uuid", unique: true, using: :btree

create_table "social_accounts", force: :cascade do |t|
  t.integer "user_id"                                     null: false
  t.string   "provider",           limit: 255          null: false
  t.string   "uid",                limit: 255             null: false
  t.string   "oauth_token",        limit: 255      
  t.string   "oauth_token_secret", limit: 255
end

add_index "users", ["user_id", "provider", "uid"], name: "index_social_accounts_on_user_id_and_provider_and_uid", unique: true, using: :btree

@fukuiretu
Copy link
Member Author

とりあえず、、、

icon: デフォルトのピンクのやつ
名前: gimeiというgemで適当につけたやつ
id: serverで適当につけたやつ

にしておいた

なんだかんだクライアントも修正箇所多そうだ。。

@fukuiretu
Copy link
Member Author

uuid、ハッシュ化しよう

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant