Conversation
… update-ruby-rails * 'update-ruby-rails' of github.com:fs/rails-base-api: Remove byebug from git history
.env.example
Outdated
|
|
||
| # Specify assets server host name, eg.: d2oek0c5zwe48d.cloudfront.net | ||
| ASSET_HOST=lvh.me:5000 | ||
| S3_ASSET_HOST=https://d1ltghz9ehkb4n.cloudfront.net |
| # CANONICAL_HOST=paste_single_hostname_here | ||
|
|
||
| # Comma separated list of IPs to access admin staff like RackMiniProfiler, Sidekiq Web, Flipper UI | ||
| IP_WHITELIST=127.0.0.1 |
There was a problem hiding this comment.
As I can see we have not this gems for now.
There was a problem hiding this comment.
Do you think we need to add RackMiniProfiler now?
| # ROLLBAR_ACCESS_TOKEN=your_key_here | ||
|
|
||
| # We send email using this "from" address | ||
| MAILER_SENDER_ADDRESS=noreply@example.com |
There was a problem hiding this comment.
Should we comment it for now? We have removed devise and we do not send emails.
There was a problem hiding this comment.
But we have mailer settings, and most of the applications send emails. Do you think our base application should be ready to send emails out of the box?
| skip_before_action :authenticate_user! | ||
|
|
||
| def create | ||
| result = CreateJwt.call(authentication_params) |
There was a problem hiding this comment.
Extract to method?
def create
if create_jwt.success?
...
else
...
end
end
def create_jwt
@create_jwt ||= CreateJwt.call(...)
end
| if result.success? | ||
| respond_with_resource(result.jwt_token, status: :created, location: nil) | ||
| else | ||
| respond_with_error(:invalid_credentials) |
There was a problem hiding this comment.
Should we expose error (error_code) in interactor and use it here?
respond_with_error(result.error_code)
in interactor
context.fail!(error_code: :invalid_credentials)
It will allow to use similar format in controllers.
| @@ -0,0 +1,35 @@ | |||
| require "securerandom" | |||
| @@ -0,0 +1,11 @@ | |||
| #!/usr/bin/env ruby | |||
|
|
||
| # Configure sensitive parameters which will be filtered from the log file. | ||
| Rails.application.config.filter_parameters += %i(password auth_token) | ||
| Rails.application.config.filter_parameters += [:password] |
There was a problem hiding this comment.
According to knock gem (https://github.com/nsarno/knock/blob/master/lib/knock/authenticable.rb#L11) token can be passed through parameter. Should we filter it to here?
| @@ -1,4 +1,4 @@ | |||
| app_config.app_generators do |g| | |||
| Rails.application.config.app_generators do |g| | |||
| g.fixture_replacement :factory_girl, dir: "spec/factories" | |||
There was a problem hiding this comment.
Should be factroy_bot as I think.
| @@ -5,8 +5,10 @@ | |||
|
|
|||
| # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. | |||
| ActiveSupport.on_load(:action_controller) do | |||
There was a problem hiding this comment.
We do not need it for jsonapi requests as I think.
|
Closed in favor of #230 |
No description provided.