LoginSignup
0
0

More than 5 years have passed since last update.

オフラインでLodgeのアカウントを作成する方法

Posted at

アカウント作成

Lodgeの仕様として、アカウント作成後はメールで送られたURLで認証する必要がある。

ただし、オフライン環境でこのメール認証は行えないため回避策が必要になる。

Lodge本体の設定

envファイルにメールの設定を持っている。

通常ならSMTPなどを指定するが開発時の試験用の方法で回避させる。

回避しなければアカウント登録ボタン押下直後にメールを送信しようとしてエラーになる。

変更前

DELIVERY_METHOD: smtp

変更後

DELIVERY_METHOD: smtp

アカウント作成方法

メール以外の新規ユーザ登録の方法がほしい #168で話されている結果bundle exec rails consoleでユーザー作成する必要がある。

※注意点として認証待ちユーザー名と同じものはエラーで弾かれる。

user = User.new(
  name:     'foo',
  provider: nil,
  uid:      nil,
  email:    'foobar@baz.com',
  password: 'foobar',
  password_confirmation: 'foobar'
)
user.skip_confirmation!
user.save!

Docker Composeを利用してる場合の手順

イメージの中に入る

docker-compose run rails bash

railsのコンソール起動

bundle exec rails console

ユーザー登録

user = User.new(
  name:     'foo',
  provider: nil,
  uid:      nil,
  email:    'foobar@baz.com',
  password: 'foobar',
  password_confirmation: 'foobar'
)
user.skip_confirmation!
user.save!
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0