{"action":"created","issue":{"url":"https://api.github.com/repos/meteor-useraccounts/core/issues/197","labels_url":"https://api.github.com/repos/meteor-useraccounts/core/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/meteor-useraccounts/core/issues/197/comments","events_url":"https://api.github.com/repos/meteor-useraccounts/core/issues/197/events","html_url":"https://github.com/meteor-useraccounts/core/issues/197","id":51597112,"number":197,"title":"Allow users to request verification email on login forbidden ","user":{"login":"splendido","id":6148980,"avatar_url":"https://avatars.githubusercontent.com/u/6148980?v=3","gravatar_id":"","url":"https://api.github.com/users/splendido","html_url":"https://github.com/splendido","followers_url":"https://api.github.com/users/splendido/followers","following_url":"https://api.github.com/users/splendido/following{/other_user}","gists_url":"https://api.github.com/users/splendido/gists{/gist_id}","starred_url":"https://api.github.com/users/splendido/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splendido/subscriptions","organizations_url":"https://api.github.com/users/splendido/orgs","repos_url":"https://api.github.com/users/splendido/repos","events_url":"https://api.github.com/users/splendido/events{/privacy}","received_events_url":"https://api.github.com/users/splendido/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/meteor-useraccounts/core/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/meteor-useraccounts/core/milestones/1","html_url":"https://github.com/meteor-useraccounts/core/milestones/v2.0","labels_url":"https://api.github.com/repos/meteor-useraccounts/core/milestones/1/labels","id":876819,"number":1,"title":"v2.0","description":"Better code and packages organization.\r\n\r\nThe idea is to have a number of core packages to be possibly integrated with plug-in packages.\r\nThese plugin-packages should include:\r\n\r\n* famous wrapper\r\n* social logins control\r\n* accounts melding\r\n* user invites\r\n* guest user\r\n* modals\r\n* registration codes\r\n* ...\r\n\r\nthe order of packages initialization will be carefully designed so to be able to add features to the base class prototype before its actual initialization.\r\n\r\nCore packages should also be used to keep the code more structured and well organized.\r\n\r\nForeseen core packages will include, at least:\r\n\r\n* base\r\n* fields\r\n* routing\r\n* configuration\r\n* i18n\r\n* core (for initialization and to be used as only dependency for front end packages)\r\n\r\nA tentative final list of packages (in order of inclusion) could be:\r\n\r\n* base (core)\r\n* fields (core)\r\n* routing (core)\r\n* configuration (core)\r\n* i18n (core)\r\n* famous wrapper (plugin)\r\n* social logins control (plugin)\r\n* accounts melding (plugin)\r\n* user invites (plugin)\r\n* guest user (plugin)\r\n* bootstrap, foundation, ionic, materialize, polymer, ratchet, semantic-ui, unstyled (front-end)\r\n* core (core)\r\n\r\nLets see!","creator":{"login":"splendido","id":6148980,"avatar_url":"https://avatars.githubusercontent.com/u/6148980?v=3","gravatar_id":"","url":"https://api.github.com/users/splendido","html_url":"https://github.com/splendido","followers_url":"https://api.github.com/users/splendido/followers","following_url":"https://api.github.com/users/splendido/following{/other_user}","gists_url":"https://api.github.com/users/splendido/gists{/gist_id}","starred_url":"https://api.github.com/users/splendido/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splendido/subscriptions","organizations_url":"https://api.github.com/users/splendido/orgs","repos_url":"https://api.github.com/users/splendido/repos","events_url":"https://api.github.com/users/splendido/events{/privacy}","received_events_url":"https://api.github.com/users/splendido/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":0,"state":"open","created_at":"2014-11-22T15:29:24Z","updated_at":"2015-02-24T23:01:47Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2014-12-10T19:02:36Z","updated_at":"2015-03-18T16:02:53Z","closed_at":null,"body":"In case `ensureEmailVerification` is set, there's no way at the moment for a user to ask another verification email.\r\nThis could be dome on the same login form (perhaps by adding another internal state?) by switching the *login* button to something like *send email again*.\r\n\r\nThis issue was originally raised by @timothyarmes with #195.\r\n\r\nIn case `ensureEmailVerification` is not set, sending another verification email is just a matter of calling `Accounts.sendVerificationEmail` which can be easily done from a *user profile page* by devs."},"comment":{"url":"https://api.github.com/repos/meteor-useraccounts/core/issues/comments/83035391","html_url":"https://github.com/meteor-useraccounts/core/issues/197#issuecomment-83035391","issue_url":"https://api.github.com/repos/meteor-useraccounts/core/issues/197","id":83035391,"user":{"login":"splendido","id":6148980,"avatar_url":"https://avatars.githubusercontent.com/u/6148980?v=3","gravatar_id":"","url":"https://api.github.com/users/splendido","html_url":"https://github.com/splendido","followers_url":"https://api.github.com/users/splendido/followers","following_url":"https://api.github.com/users/splendido/following{/other_user}","gists_url":"https://api.github.com/users/splendido/gists{/gist_id}","starred_url":"https://api.github.com/users/splendido/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splendido/subscriptions","organizations_url":"https://api.github.com/users/splendido/orgs","repos_url":"https://api.github.com/users/splendido/repos","events_url":"https://api.github.com/users/splendido/events{/privacy}","received_events_url":"https://api.github.com/users/splendido/received_events","type":"User","site_admin":false},"created_at":"2015-03-18T16:02:53Z","updated_at":"2015-03-18T16:02:53Z","body":"all you have to do on the server side is call [Accounts.sendVerificationEmail](https://docs.meteor.com/#/full/accounts_sendverificationemail).\r\n\r\nSo I guess that when you get the \"you need to verify your email\" message you could add another button below \"Login\" (to say one) and call a custom server-side method taking the username or email the user entered into the form, in turn this method should call `Accounts.sendVerificationEmail`.\r\n\r\n\r\nyou should also be able to use a submit hook to test this particular case (not tested!!!!):\r\n\r\n```javascript\r\nvar myOnSubmitHook = function(error, state){\r\n  if (error.details == verifyError and status == 'signIn') {\r\n    // add a button here\r\n  }\r\n};\r\n\r\nAccountsTemplates.configure({\r\n  onSubmitHook: myOnSubmitHook\r\n})\r\n```\r\n\r\nHere is the error thrown [error](https://github.com/meteor-useraccounts/core/blob/c963bbb5fbeab88e9398404ab002360f48c47eec/lib/server.js#L112)"}}