Kısa süre önce Devise 1.2'den 1.4.9'a yükseltildim ve her şey benim onaylanabilir modülüm dışında çalışıyor gibi görünüyor. E-posta tüm sürecin yanı sıra çalışır. Ancak onay sayfası her zaman boş. Çalışır ve e-posta hesabını onaylar, ancak kullanıcıyı yeniden yönlendirmez ve bir 406 hatası atar. Yanlış onay girişimleri için aynı şeyi yapar.devise onaylanamaz en yeni sürümde çalışmıyor
Yollar iyi görünüyor, kullanıcı modelimde belirtilebilir bir onay var ve başka hiçbir şey değişmedi.
Herhangi bir fikrin var mı? Bazı ayarları veya 1.4.9 için güncellemem gereken bir şey mi eksik?
GÜNCELLEME
URL oluşturuluyor ile ilgili bir sorun gibi görünüyor. Bilinmeyen bir nedenden dolayı, doğrulama URL'sini kullanıcı adıyla önceden mi tahmin ediyor? ve bu kırılmasına neden oluyor. Ama hala nasıl düzelteceğimi bilmiyorum.
http://localhost:5000/users/confirmation.someusername?confirmation_token=R7apAPhC5c3rszvhsowp
kullanıcı ismi yukarıda çalışmamasına süreci neden olur.
Denetleyicinin arasındaki fark 1.2'de (çalışır) ve yeni sürümde kontrol ettim.
# GET /resource/confirmation?confirmation_token=abcdef
def show
self.resource = resource_class.confirm_by_token(params[:confirmation_token])
if resource.errors.empty?
set_flash_message :notice, :confirmed
sign_in_and_redirect(resource_name, resource)
else
render_with_scope :new
end
end
1,2
1.4.9
# GET /resource/confirmation?confirmation_token=abcdef
def show
self.resource = resource_class.confirm_by_token(params[:confirmation_token])
if resource.errors.empty?
set_flash_message(:notice, :confirmed) if is_navigational_format?
sign_in(resource_name, resource)
respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) }
else
respond_with_navigational(resource.errors, :status => :unprocessable_entity){ render_with_scope :new }
end
end
protected
# The path used after resending confirmation instructions.
def after_resending_confirmation_instructions_path_for(resource_name)
new_session_path(resource_name)
end
# The path used after confirmation.
def after_confirmation_path_for(resource_name, resource)
after_sign_in_path_for(resource)
end
hata
Started GET "https://stackoverflow.com/users/confirmation.sdfsdfsd?confirmation_token=vmxmx73xvM7sUfcvH9CX" for 127.0.0.1 at 2011-10-31 13:30:33 +0100
Processing by Devise::ConfirmationsController#show as
Parameters: {"confirmation_token"=>"vmxmx73xvM7sUfcvH9CX"}
SQL (1.1ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"users"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
User Load (1.2ms) SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = 'vmxmx73xvM7sUfcvH9CX' LIMIT 1
SQL (0.7ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"users"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
Completed 406 Not Acceptable in 28ms
o url 406 /users/confirmation.someusername neden oluyor? ... ".somkullanici" (nokta dahil) geri istediğiniz yanıt biçimi olarak ele alınacaktır. Belki de rota.rb dosyasında rota yönlendirme kuralını denerseniz, bu 'get /users/confirmation.:kullanıcı adı ',: controller =>: users,: action => confirmation ... –