mongodb / stitch-js-sdk

MongoDB Stitch JavaScript SDK
Apache License 2.0
113 stars 67 forks source link

resendConfirmationEmail from Email/Password provider is not using the designated function #335

Open JMattC opened 4 years ago

JMattC commented 4 years ago

As the title says, when you use the resendConfirmationEmail it sends the default Email and doesn't call the confirmation function.

resendConfirmationEmail function, as stated in the documentation, const emailPasswordClient = Stitch.defaultAppClient.auth.getProviderClient(UserPasswordAuthProviderClient.factory) emailPasswordClient.resendConfirmationEmail(this.email)

image

jsflax commented 4 years ago

Hi there,

Can you please check if this is still occurring?

JMattC commented 4 years ago

it's still occurring (mongodb-stitch-browser-sdk: 4.7.1)

mrmaiko commented 4 years ago

This is happening for us as well.

drewdipalma commented 4 years ago

Hi Folks, we're in the process of adding a new method to re-run the custom confirmation function from the SDKs. In the short term, the endpoint exists in the Stitch API – https://stitch.mongodb.com/api/client/v2.0/app/[APP ID]/auth/providers/local-userpass/confirm/call

and takes a body of {"email":"[EMAIL]"}. Here's an example of how this workaround might be used –

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://stitch.mongodb.com/api/client/v2.0/app/[APP ID]/auth/providers/local-userpass/confirm/call",
  "method": "POST",
  "headers": {
    "cache-control": "no-cache",
    "postman-token": "87512465-fca9-678c-6e2a-182552dea48b"
  },
  "data": "{\"email\":\"[User Email]\"}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
mrmaiko commented 4 years ago

I'm trying this now, @drewdipalma , hopefully it works because users complaining in droves.

mrmaiko commented 4 years ago

@drewdipalma I can't seem to get this to work. my requests are just resulting in 404's.

drewdipalma commented 4 years ago

@mrmaiko I have confirmed that the endpoint is live for your application going by the application listed in your support ticket. It appears you are calling: https://stitch.mongodb.com/api/client/v2.0/app/[APP ID]/confirm/call vs. the above: https://stitch.mongodb.com/api/client/v2.0/app/[APP ID]/auth/providers/local-userpass/confirm/call

csroysudarshan commented 3 years ago

@drewdipalma Any timeline for implementing this.

xdeleon commented 3 months ago

Was this function ever implemented in the client SDK?