mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2026-02-23 15:50:00 +01:00
fix(example-auth): convert UTC to local time
Requires chrono 0.2.3 to work. Also removed some warnings
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
extern crate "yup-oauth2" as oauth2;
|
||||
extern crate "yup-hyper-mock" as mock;
|
||||
extern crate hyper;
|
||||
extern crate chrono;
|
||||
extern crate getopts;
|
||||
|
||||
use chrono::{Local};
|
||||
use getopts::{HasArg,Options,Occur,Fail};
|
||||
use std::os;
|
||||
use std::old_io::{File, FileMode, FileAccess};
|
||||
@@ -53,7 +55,7 @@ fn main() {
|
||||
given scopes. This is not a test !\n\
|
||||
You have time until {} to do that.
|
||||
Do not terminate the program until you deny or grant access !",
|
||||
pi.user_code, pi.verification_url, pi.expires_at);
|
||||
pi.user_code, pi.verification_url, pi.expires_at.with_timezone(&Local));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +66,7 @@ fn main() {
|
||||
.retrieve_token(client, &client_id, &client_secret, &m.free) {
|
||||
println!("Authentication granted !");
|
||||
println!("You should store the following information for use, or revoke it.");
|
||||
println!("All dates are given in UTC.");
|
||||
println!("{:?}", t);
|
||||
} else {
|
||||
println!("Invalid client id, invalid scope, user denied access or request expired");
|
||||
|
||||
@@ -8,7 +8,7 @@ use hyper;
|
||||
use hyper::header::ContentType;
|
||||
use url::form_urlencoded;
|
||||
use itertools::Itertools;
|
||||
use rustc_serialize::{self, json};
|
||||
use rustc_serialize::json;
|
||||
use chrono::{DateTime,UTC};
|
||||
|
||||
use common::{Token, AuthenticationType};
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::time::Duration;
|
||||
use chrono::UTC;
|
||||
use hyper;
|
||||
use hyper::header::ContentType;
|
||||
use rustc_serialize::{self, json};
|
||||
use rustc_serialize::json;
|
||||
use url::form_urlencoded;
|
||||
use super::Token;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user