Start a new topic

User Verification with Email

Hey,





i am facing the following problem:



We are using email verification by kinvey to ensure our users have a guilty e-mail adress.



Situation:

The User (at first start) lands on the loginpage of the application. After a registration the user is automatically logged in, but this (of course) doesn't work correct, because the account have to confirmed per email at first.



Is there a way to prevent that auto-login after registration? (Or do i have to call a seperate logout function, which i've tried before, but doesn't seem to work)





(Backbone, Titanium)






Ah, thanks for that. :)



(It's because the app should connect to kinvey and if the user is in the login screen, there has to be a prompt ala "Hey please verify your mail first [OK] [Send Again]



You should be able to call `logout` directly after registering, I think in this case you need the force flag (because the user is unverified):



```

user.login('username', 'password').then(function() {

user.logout({ force: true });

});

```



If all else fails, you can manually unset the user using `Kinvey.setActiveUser(null)`.
"the error" is, that the pinging fails in this scenario:





New user --> register (mail send with verification) user restarts the app (without verification) ... The app than still holds the user as the current user, but i can't call logout on the user...



And because there is that user, the ping on kinvey fails every time.





I thought the init and ping of Kinvey are not connected to the currentActive User instance, but that seems to be wrong.
I recommend calling logout. Do you have any details / code of what you’re trying and if there’s an error?
Login or Signup to post a comment