Created
June 6, 2018 05:42
-
-
Save TakuyaHarayama/e0a1893d56862ee179a5c7ee47ad4cf0 to your computer and use it in GitHub Desktop.
GraphqlとKnockを使った認証処理 https://github.com/nsarno/knock/issues/194
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GraphqlController < ActionController::Base | |
include Knock::Authenticable | |
before_action :authenticate | |
def execute | |
# snip... | |
context = { | |
# Query context - +current_user+ is available when authenticated: | |
current_user: current_user, | |
} | |
# snip... | |
render json: result | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment