MLstate / opalang

The Opa Language for Web Application Development
http://opalang.org
Other
1.25k stars 126 forks source link

[enhance] facebook: allow the use of a dispatcher #129

Closed samueltardieu closed 11 years ago

samueltardieu commented 11 years ago

The Facebook token retriever function requires a raw unparsed query string that it parses immediately. This prevents users from using a dispatcher because the query string has been parsed already.

This change allows either a query string or a list of tuples to be used when handling the answer coming from Facebook redirection.

Example:

    function connect(query) {
        match (FBA.get_token(query, redirect)) { … }
    }
…
    match (url) {
        case {path:["connect"] ...} : connect(url.query)
    }