Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAuthUrl does not return a promise, and causes Typescript compilation errors #27

Closed
jlengrand opened this issue Jul 12, 2018 · 1 comment

Comments

@jlengrand
Copy link

See https://github.com/esteban-uo/picasa/blob/master/src/picasa.js#L129

getAuthUrl directly returns a String, but the doc mentions a Promise.

Using the code as follows :

app.get('/login', (req, res) => {
    const authURL = picasa.getAuthURL(googleConfig);
    res.redirect(authURL);
});

raises the following Typescript compilation error:

scripts/loginAndGetGoogleToken.ts:21:18 - error TS2345: Argument of type 'Promise<any>' is not assignable to parameter of type 'string'.

21     res.redirect(authURL);
                    ~~~~~~~

Because microsoft/TypeScript#19139 is still open, there is no way to fix this without changing the documentation.

The doc for this method should be changed, and mention that it returns a String instead.

@jlengrand
Copy link
Author

Alright, see #28 for super minor fix.

Since it is my 2nd contribution, I added myself as a contributor. Let me know if that is an issue :).

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant