Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: lib/src/authorization_code_grant.dart

Issue 1953643002: Fix all strong-mode warnings. (Closed) Base URL: git@github.com:dart-lang/oauth2.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/credentials.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:http/http.dart' as http; 7 import 'package:http/http.dart' as http;
8 8
9 import 'client.dart'; 9 import 'client.dart';
10 import 'authorization_exception.dart'; 10 import 'authorization_exception.dart';
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 _state = _State.finished; 233 _state = _State.finished;
234 234
235 return await _handleAuthorizationCode(authorizationCode); 235 return await _handleAuthorizationCode(authorizationCode);
236 } 236 }
237 237
238 /// This works just like [handleAuthorizationCode], except it doesn't validate 238 /// This works just like [handleAuthorizationCode], except it doesn't validate
239 /// the state beforehand. 239 /// the state beforehand.
240 Future<Client> _handleAuthorizationCode(String authorizationCode) async { 240 Future<Client> _handleAuthorizationCode(String authorizationCode) async {
241 var startTime = new DateTime.now(); 241 var startTime = new DateTime.now();
242 242
243 var headers = {}; 243 var headers = <String, String>{};
244 244
245 var body = { 245 var body = {
246 "grant_type": "authorization_code", 246 "grant_type": "authorization_code",
247 "code": authorizationCode, 247 "code": authorizationCode,
248 "redirect_uri": this._redirectEndpoint.toString() 248 "redirect_uri": this._redirectEndpoint.toString()
249 }; 249 };
250 250
251 if (_basicAuth && secret != null) { 251 if (_basicAuth && secret != null) {
252 headers["Authorization"] = basicAuthHeader(identifier, secret); 252 headers["Authorization"] = basicAuthHeader(identifier, secret);
253 } else { 253 } else {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // [AuthorizationCodeGrant.handleAuthorizationResponse] or 296 // [AuthorizationCodeGrant.handleAuthorizationResponse] or
297 // [AuthorizationCodeGrant.handleAuthorizationCode] have been called. 297 // [AuthorizationCodeGrant.handleAuthorizationCode] have been called.
298 static const finished = const _State("finished"); 298 static const finished = const _State("finished");
299 299
300 final String _name; 300 final String _name;
301 301
302 const _State(this._name); 302 const _State(this._name);
303 303
304 String toString() => _name; 304 String toString() => _name;
305 } 305 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/credentials.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698