magic-js icon indicating copy to clipboard operation
magic-js copied to clipboard

Improve OAuth types

Open mightymatth opened this issue 3 years ago • 2 comments

✅ Prerequisites

  • [x] Did you perform a cursory search of open issues? Is this feature already requested elsewhere?
  • [x] Are you reporting to the correct repository (magic-sdk)?

✨ Feature Request

Either export HiddenExtensionFields interface or create a new one:

export declare class SDKBase {
    auth: Omit<OAuthExtension, HiddenExtensionFields>
}

🧩 Context

When I create a Magic instance:

new Magic({..., extensions: [new OAuthExtension()])

...this returns:

SDKBase & {auth: Omit<OAuthExtension, HiddenExtensionFields>}

Now, if I want to declare this variable, I need to make my own interface or type because HiddenExtensionFields is not exported. It would be nice to export it or have another interface that represents OAuthExtension without hidden fields so API consumers could use it.

mightymatth avatar Feb 28 '22 10:02 mightymatth

@mightymatth, our apologies for the delay in responding to this issue. I wanted to let you know that this items has been recorded and will be reviewed by our team for roadmap consideration. Thank you for the feature request, it's highly appreciated!

ayv8er avatar Oct 17 '23 14:10 ayv8er

Hey @mightymatth, I would love to better understand your use case. Are you looking to implement the OAuth extension within the auth namespace, such as using magic.auth.loginWithRedirect? If that's not the case, could you provide more details about your specific scenario?

Ethella avatar Nov 05 '23 19:11 Ethella