File: session_spec.cr

package info (click to toggle)
crystal 1.14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,384 kB
  • sloc: javascript: 6,400; sh: 695; makefile: 269; ansic: 121; python: 105; cpp: 77; xml: 32
file content (12 lines) | stat: -rw-r--r-- 413 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
require "oauth2"
require "http/client"

module OAuth2
  typeof(begin
    client = Client.new "localhost", "client_id", "client_secret", redirect_uri: "uri", authorize_uri: "/baz"
    token = OAuth2::AccessToken::Bearer.new("token", 3600)
    session = Session.new(client, token) { |_| }
    session = Session.new(client, token, Time.utc) { |_| }
    session.authenticate(HTTP::Client.new("localhost"))
  end)
end