A
A
Anton Misyagin2015-04-15 23:25:08
Ruby on Rails
Anton Misyagin, 2015-04-15 23:25:08

How to register a user from VK on devise?

I read the forum and did not find similar questions. Rails 4+ devise 3 + omniauth. To begin with, I will try to get by with a description of the issue in a general form without code. The following was implemented: Classic registration (email+password) without email confirmation. Then added an entrance (+ automatic registration at the first entrance) through VK, twitter and facebook. Now I don’t remember exactly, but only twitter sends email, the other two networks hide the user’s soap. I managed then by stuffing something like [email protected]+provider+.ru into the email field
Unique non-existent emails were obtained, for example, [email protected], [email protected], etc.). After the expiration of time, it took real addresses from users. Enabled confirmation on devise. Classic registration works with a bang. The user registers - a letter with a token is sent to the soap. He follows the link - the account is confirmed and the user can log in. Then, on the user settings form, he can change the mail - the letter is sent to a new email again. The old one is not overwritten in the database yet. As soon as the user confirms a new email, the device updates the record in the database and the email becomes different. Now the main problem. I'm trying to log in through social networks - an entry is created in the database with a non-existent email. A confirmation email is sent to it, meanwhile the usercannot access my site under his account until he confirms it. Thus, he cannot log in and set a new email - real and subsequently confirm it.
Once again what I need.

  • Or you need the devise, after registering through social networks, to let you into your account without email confirmation - then I will force you to enter a real one, which will later be confirmed. Well, i.e. The account is not verified, but you can log in.
  • Or, at the entrance, I would have been given the user's social network email, which he indicated when registering in these (which I think is not feasible).
  • Or I need a way to which I did not guess.

Those. it turns out, I think a common task is how to use a device with email confirmation enabled to register new users coming from social networks that do not provide the user's email ?
Thank you for reading so many letters)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Misyagin, 2015-04-16
@sunnmas

In, it looks like what I need))

# ==> Configuration for :confirmable
  # A period that the user is allowed to access the website even without
  # confirming his account. For instance, if set to 2.days, the user will be
  # able to access the website for two days without confirming his account,
  # access will be blocked just in the third day. Default is 0.days, meaning
  # the user cannot access the website without confirming his account.
  config.allow_unconfirmed_access_for = 2.days

Works.
True, today when registering on ivi.ru, I saw the following:
Question: how to get access to an email address from my application?
Found the answer here on the site:
Link

A
Alexey, 2015-04-17
@fuCtor

the model object has a method: skip_confirmation!
stackoverflow.com/questions/20798573/skip-email-co...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question