Skip to content

POST, CORS and Turbo #34

@curtis741

Description

@curtis741

If your using Turbo, you might see this behavior when trying to follow the redirect from Omniauth:
image

Where the browser POST's to the Rails server, gets the 302 redirect to Okta but then fails on CORs verification. This happens when you are using Turbo in your rails app and to fix it you should make a login button like this:

<%= button_to "Login via Okta", user_okta_omniauth_authorize_path, method: :post, form: {"data-turbo" => "false"}%>

I figured this out by following what this comment said:
hotwired/turbo#45 (comment)

This might be worth putting in the readme as a weird gotcha?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions