@@ -597,7 +597,7 @@ plugin.githubLogin = function(user, cb) {
597
597
_request . get ( { url : leetcodeUrl } , function ( e , resp , body ) {
598
598
const redirectUri = resp . request . uri . href ;
599
599
if ( redirectUri !== 'https://leetcode.com/' ) {
600
- return cb ( 'GitHub login failed or GitHub did not link to leetcode ' ) ;
600
+ return cb ( 'GitHub login failed or GitHub did not link to LeetCode ' ) ;
601
601
}
602
602
const cookieData = parseCookie ( resp . request . headers . cookie , cb ) ;
603
603
saveAndGetUser ( user , cb , cookieData ) ;
@@ -606,8 +606,8 @@ plugin.githubLogin = function(user, cb) {
606
606
} ) ;
607
607
} ;
608
608
609
- plugin . linkinedLogin = function ( user , cb ) {
610
- const leetcodeUrl = config . sys . urls . linkined_login ;
609
+ plugin . linkedinLogin = function ( user , cb ) {
610
+ const leetcodeUrl = config . sys . urls . linkedin_login ;
611
611
const _request = request . defaults ( {
612
612
jar : true ,
613
613
headers : {
@@ -616,11 +616,11 @@ plugin.linkinedLogin = function(user, cb) {
616
616
} ) ;
617
617
_request ( 'https://www.linkedin.com' , function ( e , resp , body ) {
618
618
if ( resp . statusCode !== 200 ) {
619
- return cb ( 'Get linkedin session failed' ) ;
619
+ return cb ( 'Get linkedIn session failed' ) ;
620
620
}
621
621
const authenticityToken = body . match ( / i n p u t n a m e = " l o g i n C s r f P a r a m " v a l u e = " ( .* ) " / ) ;
622
622
if ( authenticityToken === null ) {
623
- return cb ( 'Get Linkedin token failed' ) ;
623
+ return cb ( 'Get LinkedIn token failed' ) ;
624
624
}
625
625
const options = {
626
626
url : 'https://www.linkedin.com/uas/login-submit' ,
@@ -638,12 +638,12 @@ plugin.linkinedLogin = function(user, cb) {
638
638
} ;
639
639
_request ( options , function ( e , resp , body ) {
640
640
if ( resp . statusCode !== 200 ) {
641
- return cb ( 'Linkedin login failed' ) ;
641
+ return cb ( 'LinkedIn login failed' ) ;
642
642
}
643
643
_request . get ( { url : leetcodeUrl } , function ( e , resp , body ) {
644
644
const redirectUri = resp . request . uri . href ;
645
645
if ( redirectUri !== 'https://leetcode.com/' ) {
646
- return cb ( 'Linkedin login failed or Linkedin did not link to leetcode ' ) ;
646
+ return cb ( 'LinkedIn login failed or LinkedIn did not link to LeetCode ' ) ;
647
647
}
648
648
const cookieData = parseCookie ( resp . request . headers . cookie , cb ) ;
649
649
saveAndGetUser ( user , cb , cookieData ) ;
0 commit comments