Laravel User Email Change: How To Verify Again?

  Рет қаралды 6,687

Laravel Daily

Laravel Daily

Күн бұрын

Пікірлер: 46
@o_lobato
@o_lobato 2 жыл бұрын
I think is best to add a secondary email first and waits confirmation for that. Then, allow the option to set the secondary to primary (and option to exclude the secondary email).
@redayoub
@redayoub 2 жыл бұрын
+1
@the-fmk
@the-fmk 2 жыл бұрын
I don't update email until user click the verification button on email. Benefit of this is user can access the website with his old email (not changed yet), when user checks his email that says "this is an email for changing your email address..." and click it, then users email will be change.
@andrexp2758
@andrexp2758 2 жыл бұрын
I think you can use $user->isDirty("email") or $user->wasChanged("email") to verify the email is or was changed before or after save().
@Appelkoekie
@Appelkoekie 2 жыл бұрын
Correct
@stojankukrika7242
@stojankukrika7242 2 жыл бұрын
I made it this way: Send verification mail on a new email; and f the user verifies a new email then update it in the user model. In case he does not confirm it all stays the same as before that.
@Appelkoekie
@Appelkoekie 2 жыл бұрын
I wanted to comment this approach, because if the user made a typo error in the email, he would lose access to his/her account. So +1 😉
@stojankukrika7242
@stojankukrika7242 2 жыл бұрын
@@Appelkoekie yes,that iz correct. Tnx 😉
@pamaju
@pamaju 2 жыл бұрын
I think it's a good idea. That way you avoid the typing error and the possibility that the account has been hacked and they want to change the email. The problem (as always) is how far one takes these scenarios, think that if the user lost access to his email and therefore wants to modify it in your app, he will never be able to do it
@stojankukrika7242
@stojankukrika7242 2 жыл бұрын
@@pamaju he can chage it in valid one because real user mail stay the same,on email verification it will be updated.
@pamaju
@pamaju 2 жыл бұрын
@@stojankukrika7242 I had read wrong, you are right!
@MDLimon-jh8yq
@MDLimon-jh8yq 8 ай бұрын
hi!, can you describe what the use of query "signature" in the verification url? Cause laravel only use the hash query to match the user email. Ref: Illuminate\Foundation\Auth\EmailVerificationRequest
@VadimBesedin
@VadimBesedin 2 жыл бұрын
I think on the temp screen with buttons "Resend Verification" and "Logout" we need to output new email address for user to see if it's right and also add another button "Change email" or "Cancel change" in case the user has provided wrong email or had a typo in it.
@Appelkoekie
@Appelkoekie 2 жыл бұрын
See Stojan Kukrika's comment for an even better solution.
@smith4591
@smith4591 2 жыл бұрын
I don't do it like this, because this is quite dangerous. If the user made a mistake while typing the email address, he/she forever locked out from the system instead I use protonemedia/laravel-verify-new-email package. I think you done a video for that package while ago.
@saydfuad6914
@saydfuad6914 2 жыл бұрын
This was my concern too
@travholt
@travholt 2 жыл бұрын
Yeah, I couldn't stop thinking about that too. And I know from experience that many users suck at either remembering or typing their e-mail addresses correctly.
@umarbabajidda9664
@umarbabajidda9664 2 жыл бұрын
Very thoughtful - this never even crossed my mind. So do you keep the new email in a temporary field or something?
@jacobtims569
@jacobtims569 2 жыл бұрын
Never thought about it that way. I'm going to use that package 👍
@maou842
@maou842 2 жыл бұрын
It makes sense.
@AhsanKhan89
@AhsanKhan89 2 жыл бұрын
Hi, Povilas, Please share your opinion about any request validation open source repository. Which can resolve Price, date of birth, password etc. Validation issues.
@Appelkoekie
@Appelkoekie 2 жыл бұрын
DoB is just date validation which is an existing rule in Laravel. Password validation is easily done with regex, just give it a quick google, the format depends on your app its needs. Price is easily done by modifying the user input to a float (or int multiplied by 100) value and just validate on that. Don't throw errors to the user for wrong input which you can fix easily programmatically. For example: if they input "€ 10,25" or "€10.25", just convert it to float 10.25 or int 1025 before sending it to the validator.
@vitalii1130
@vitalii1130 2 жыл бұрын
@@Appelkoekie Never Use Floats for Money! Only integer or decimal type
@Appelkoekie
@Appelkoekie 2 жыл бұрын
@@vitalii1130 i was talking about php data types, not sql data types, and you can perfectly use float values for money in php, only you should round it to 2 decimals after operations.
@vitalii1130
@vitalii1130 2 жыл бұрын
@@Appelkoekie using integers is much better, no need to mess with round everythere in code)
@Appelkoekie
@Appelkoekie 2 жыл бұрын
@@vitalii1130 its not better , cause then you need to mess while calculating numbers as well. Integers is only "better" when storing in database.
@jawadahmad8198
@jawadahmad8198 2 жыл бұрын
Hello! I want logged in users to change their name, email, password, address, phone and image. I'm using Laravel ui/auth package to register users. How can i acheive this? Any guidence please. Give me solution as I'm stuck at this point.
@janfornication
@janfornication 2 жыл бұрын
You can't do it in this way, because if the user enters a wrong mail the user ist locked out from your application.
@janfornication
@janfornication 2 жыл бұрын
I would send the mail first and when the user hit the link in the mail, than i would switched the email on user model without "hard" reverification
@SouravTah
@SouravTah 2 жыл бұрын
I want to send Email OTP instead of verification link. Does anyone have any package suggestions for Email OTP sending and verification process?
@makerdave42
@makerdave42 2 жыл бұрын
I think the best solution does not make ANY changes to the user's email unless the verification is completed. Profile update requests get the email stripped out of the update data that updates the model. If the email address is different from the stored value, send a notification to the new address with the a link to perform the action. The link contains the user ID (uuid in this case), an encrypted version of the new email address and is signed (expires in one hour). The app (controller/model/service) then decrypts the new email address from the route parameter and updates the database. If you want to update the email verified at date, use the function markEmailAsVerified(). Note: User is logged in so we have to trust the user making the request is the actual user.
@marcincook
@marcincook 2 жыл бұрын
1. alaways re-verify if your business logick require working email like transactionals confirmation etc in webshop or confirmation for orders or similar. 2. method is ok but bether i think is validation dns if user used email like order somethink in shop and you need send email to user with details of transaction or coupon code for delivery, or access to new vps etc. businel logick. But not only if user change email, if use...
@seppdaniel
@seppdaniel 2 жыл бұрын
Would rather stick this into the User model with on "updating" and check old and new value there.
@hosamgnaba3205
@hosamgnaba3205 2 жыл бұрын
sir, would you mind to change your github to dark mode please, much more comfortable on our eyes it would be awesome, thank you
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Sorry for me personally it would be uncomfortable, I don't work at night.
@Appelkoekie
@Appelkoekie 2 жыл бұрын
@@LaravelDaily I always work on dark mode, also during the day in a bright environment, not only at night. At the end of the day my eyes feel less tired.
@ngetichishmael
@ngetichishmael 2 жыл бұрын
Hello Laravel Dailly, Out of context but I followed this tutorial you did 2 years ago, kzbin.info/www/bejne/n6asdqSFmLacbMk, I followed it successfully and implemented it in my project but my project needs to track quantity and subtract from the total. For example, the total is 300 so when you make the first form with quantity 100, the 300 should be subtracted on the fly to prevent users from entering more than the total quantity, So my question is how do you capture the update of quantity on the fly. Or better suggest how I can implement that.
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Sorry I don't remember such old tutorials by heart what I did in that video 2 years ago.
@DevduttaBain
@DevduttaBain 2 жыл бұрын
You must bring max quantity for each product with the product list. and check it on every possible quantity update method. I guess.
@AhmedMohammed-vo5if
@AhmedMohammed-vo5if 2 жыл бұрын
hi i have questions is there any way to print from web server to local printer 🖨️ !? by laravel
@REJack89
@REJack89 2 жыл бұрын
I've used the "protonemedia/laravel-verify-new-email"-package to accomplish this wihtout many hassle 😄, it could be nice for a package preview/showcase here.
laravel email send - laravel mailtrap - in arabic
10:01
يوميات مطور مواقع
Рет қаралды 8 М.
BIG News From Laracon EU 2025: My Opinions
14:15
Laravel Daily
Рет қаралды 8 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Laravel Security: Top 7 Mistakes Developers Make
11:16
Laravel Daily
Рет қаралды 89 М.
Laravel Eloquent: Deeper Relationships with One Query
10:37
Laravel Daily
Рет қаралды 147 М.
Laravel Package: Verify New Email After Changing It
7:27
Laravel Daily
Рет қаралды 8 М.
Laravel Mobile Phone Verification: SMS with Vonage (ex Nexmo)
8:45
Laravel Daily
Рет қаралды 38 М.
Laravel API Code Review: Inconsistent Code May Cost You a Job
10:47
Laravel Daily
Рет қаралды 10 М.
Laravel Tutorial For Beginners (Simple User CRUD App)
1:16:13
LearnWebCode
Рет қаралды 225 М.
New In Laravel 7 - e08 - Mail Markdown Templates
4:28
Coder's Tape
Рет қаралды 33 М.