Add out-of-band auth, + always call a callback

I am fine either way, just never saw that before.

Doug

On Wed, Sep 24, 2014 at 4:08 PM, Charlie Stigler <notifications@github.com>
wrote:

> In Classes/ios/EMConnectLoginView.m:
>
> > @@ -198,16 +197,20 @@ - (void)webViewDidFinishLoad:(UIWebView *)webView
> >              NSString *component = [fragmentComponents objectAtIndex:i];
> >              if ([component rangeOfString:@"access_token="].location != NSNotFound) {
> >                  NSString *accessToken = [component stringByReplacingOccurrencesOfString:@"access_token=" withString:@""];
> > -                if (!accessToken) {
> > -                    // FIXME(dbanks)
> > -                    // Is this an error or a cancel?
> > -                    _cancelHandler();
> > -                } else {
> > -                    _successHandler(accessToken);
> > -                }
> > +                if ([accessToken length]) {
> > +                    return _successHandler(accessToken);
>
> ah, you can switch to _successHandler(); return;, that's probably more
> standard. I use a lot of callbacks in my day-to-day code (Node.js), and
> I've found that combining the return with the callback helps me avoid
> bugs where I forget the return statement... which can get really weird with
> multiple callbacks called, etc
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dougbanks/EdmodoConnectIOS/pull/3/files#r18006416>.
>



-- 

*Doug Banks*
Edmodo App Studio
*https://www.edmodo.com/dougbanks <https://www.edmodo.com/dougbanks>*