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

Torii oAuth Static Redirect Page not served as asset with Ember-CLI-Rails #547

Open
hhff opened this issue Aug 27, 2017 · 3 comments
Open

Comments

@hhff
Copy link

hhff commented Aug 27, 2017

Hi there! Thanks so much for this lib - it's made my life super easy! I love it - congrats!

I'm using Torii for integrating Stripe Connect.

The Torii lib has deprecated the redirect_uri for oAuth being a URL that loads your ember app (for security reasons), and now expect that you'll point to their static HTML page instead (in the host app it's available as a static asset at localhost:4200/torii/redirect.html).

When serving the app from Ember CLI Rails, however, the /torii/redirect.html route is not considered an asset, but treated as an Ember route, and thus loads the application (creating the aforementioned security risk).

I'm guessing there's somewhere in Ember-CLI-Rails (or in the rails stack) that is treating .html as an app route rather than an asset.

Of course I could move the redirect page into rails, but ideally, I'd rather serve the page directly from Torii for that it's not something I need to update when upgrading Torii in the future.

Any suggestions for handling this?


Which operating system and version is the project developed on?
Mac OS Sierra

Which version of ruby is the project developed on?
2.3.1

Which version of npm is the project developed on?
Yarn

Which version of ember-cli is the project developed on?
2.14

What is the rails version?
5.1

What is the ember-cli-rails version (from Gemfile)?
0.9

What is the ember-cli-rails-addon version (from package.json)?
0.8

Is your application server multi-threaded
(such as puma and unicorn) or is it multi-process (such as thin and webrick)?

puma

What are the contents of config/initializers/ember.rb?

EmberCli.configure do |c|
  c.app :dash, build_timeout: 60
end

What are the contents of the Rails' view that renders the Ember application?
NA

How are the EmberCLI-related routes defined?

class DashSubdomain
  def self.matches? request
    request.subdomain == 'dash'
  end
end

Rails.application.routes.draw do

  constraints(DashSubdomain) do
    mount_ember_app :dash, to: "/"
  end

  # etc
end
@adambedford
Copy link

I'm also interested in this

@cwick
Copy link

cwick commented Apr 30, 2020

I also need the ability to serve HTML files as a static asset

@cwick
Copy link

cwick commented Apr 30, 2020

I'm working around it for now by manually defining a route to the static HTML file in routes.rb, and using

send_file Rails.root.join('path/to/html_file''), type: 'text/html; charset=utf-8', disposition: 'inline'

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

3 participants