Skip to content
This repository was archived by the owner on Sep 24, 2019. It is now read-only.

Commit 7d2e373

Browse files
authored
Merge pull request #32 from GraphQLAcademy/headers
headers auth
2 parents 657a86b + e33c51b commit 7d2e373

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

config/initializers/graphiql.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require "base64"
2+
3+
GraphiQL::Rails.config.headers['Authorization'] = -> (context) do
4+
credentials = Base64.strict_encode64("#{context.params['username']}:#{context.params['password']}")
5+
"basic #{credentials}"
6+
end

0 commit comments

Comments
 (0)