jbreckmckye / electron-auth0-login

Helper widget for Auth0 authentication in Electron desktop apps
MIT License
28 stars 19 forks source link

Types issue #29

Closed ceremonious closed 3 years ago

ceremonious commented 3 years ago

Hi, thank you for creating this library! I saw that you released v2 right as I was looking to integrate Auth0 & Electron.

I'm getting a type error when trying to call getToken() because I'm not passing in any arguments.

The library seems to be generating the following types for the auth object (This is the index.d.ts file in node_modules/electron-auth0-login/dist):

import { Config } from './types';
declare const _default: (config: Config) => {
    getToken: (input: unknown) => Promise<string>;
    isLoggedIn: (input: unknown) => boolean;
    login: (input: unknown) => Promise<string>;
    logout: (input: unknown) => Promise<void>;
};
export = _default;
jbreckmckye commented 3 years ago

Thanks for the report. I'll take a look at this later today (maybe tonight).

We should be erasing those input types. Actually it might be beneficial to try to alias to an explicit library type.

jbreckmckye commented 3 years ago

@ceremonious I've just pushed version 2.0.1, which should fix the types.

ceremonious commented 3 years ago

Thank you!

jbreckmckye commented 3 years ago

Let me know if you have any further issues