Sha256: cf0c366109cd0378c125d2765bcb8fde9c9777143a96701fa1bc592a6cc2f3dd
Contents?: true
Size: 696 Bytes
Versions: 9
Compression:
Stored size: 696 Bytes
Contents
class Auth::RegisteredUserController < ApplicationController include RedirectIfAuthenticated skip_authenticate layout 'guest' def new @form = Auth::RegisterForm.new render 'auth/register' end def create @form = Auth::RegisterForm.new(params.permit(:name, :email, :password, :password_confirmation)) return render 'auth/register', status: :unprocessable_entity if @form.invalid? user = User.create(name: @form.name, email: @form.email, password: @form.password) if User.include?(MustVerifyEmail) && !user.has_verified_email? user.send_email_verification_notification end Current.auth.login(user) redirect_to dashboard_path end end
Version data entries
9 entries across 9 versions & 1 rubygems