Search results
Top results related to reset your password mail server gmail mobile email
Top Answer
Answered May 18, 2022 · 8 votes
If you want to override behaviour of \Illuminate\Auth\Passwords\DatabaseTokenRepository methods, you will have to build your own token repository, overriding methods in the existing repository that currently just check for the 'email' column in the database. Ensure you've created a migration to add the appropriate column:
<?php-use Illuminate\Database\Migrations\Migration;use Illuminate\Database\Schema\Blueprint;use Illuminate\Support\Facades\Schema;return new class extends Migration{ public function up(): void { $tname = config("auth.passwords.users.table"); Schema::table($tname, fn (Blueprint $t) => $t->string("mobile", 16)); } public function down(): void { $tname = config("auth.passwords.users.table"); Schema::table($tname, fn (Blueprint $t) => $t->dropColumn("mobile")); }}
Then create your custom repository:
app/Auth/DatabaseTokenRepository.php
<?php-namespace App\Auth;use Illuminate\Auth\Passwords\DatabaseTokenRepository as DatabaseTokenRepositoryBase;use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;use Illuminate\Support\Carbon;class DatabaseTokenRepository extends DatabaseTokenRepositoryBase;{ // // Override these methods to use mobile as well as email // public function create(CanResetPasswordContract $user) { $email = $user->getEmailForPasswordReset(); $mobile = $user->getMobileForPasswordReset(); $this->deleteExisting($user); $token = $this->createNewToken(); $this->getTable()->insert($this->getPayload($email, $mobile, $token)); return $token; } protected function deleteExisting(CanResetPasswordContract $user) { return $this->getTable() ->where("email", $user->getEmailForPasswordReset()) ->orWhere("mobile", $user->getMobileForPasswordReset()) ->delete(); } protected function getPayload($email, $mobile, $token): array { return [ "email" => $email, "mobile" => $mobile, "token" => $this->hasher->make($token), "created_at" => new Carbon(), ]; } public function exists(CanResetPasswordContract $user, $token) { $record = (array) $this->getTable() ->where("email", $user->getEmailForPasswordReset()) ->orWhere("mobile", $user->getMobileForPasswordReset()) ->first(); return $record && ! $this->tokenExpired($record["created_at"]) && $this->hasher->check($token, $record["token"]); } public function recentlyCreatedToken(CanResetPasswordContract $user) { $record = (array) $this->getTable() ->where("email", $user->getEmailForPasswordReset()) ->orWhere("mobile", $user->getMobileForPasswordReset()) ->first(); return $record && $this->tokenRecentlyCreated($record['created_at']); }}
Now you will need to use this custom token repository instead of the default one. So you have to override another class.
app/Auth/PasswordBrokerManager.php
<?phpnamespace App\Auth;use Illuminate\Support\Str;use Illuminate\Auth\Passwords\PasswordBrokerManager as PasswordBrokerManagerBase;class PasswordBrokerManager extends PasswordBrokerManagerBase{ protected function createTokenRepository(array $config) { $key = $this->app['config']['app.key']; if (Str::startsWith($key, 'base64:')) { $key = base64_decode(substr($key, 7)); } $connection = $config['connection'] ?? null; // return an instance of your new repository // it's in the same namespace, no need to alias it return new DatabaseTokenRepository( $this->app['db']->connection($connection), $this->app['hash'], $config['table'], $key, $config['expire'] ); }}
Now you have created a custom broker to use your custom repository. You need a new service provider to make use of it.
app/Providers/PasswordResetServiceProvider.php
<?phpnamespace App\Providers;use App\Auth\PasswordBrokerManager;use Illuminate\Auth\Passwords\PasswordResetServiceProvider as PasswordResetServiceProviderBase;class PasswordResetServiceProvider extends PasswordResetServiceProviderBase{ protected function registerPasswordBroker() { $this->app->singleton('auth.password', function ($app) { // reference your new broker // the rest of the method code is unchanged return new PasswordBrokerManager($app); }); $this->app->bind('auth.password.broker', function ($app) { return $app->make('auth.password')->broker(); }); }}
Next, replace default password reset service provider with the custom one in your application config: app/config/app.php
<?php-return [ "providers" => [ ... // Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, App\Providers\PasswordResetServiceProvider::class, ... ],];
And finally, define the getMobileForPasswordReset() method on your user model:
<?php-namespace App;use Illuminate\Foundation\Auth\User as Authenticatable;...class User extends Authenticatable{ ... public method getMobileForPasswordReset() { return $this->mobile; }}
1/5
Top Answer
Answered Jun 09, 2023 · 0 votes
I can see that email is delivered to mail server; DEBUG SMTP: message successfully delivered to mail server
Seems likely that the problem is downstream from Spring Boot.
Mail Relay
You are sending to a mail relay (=SMTP server). Are send logs available there?
Spam
Ask yourself whether the email server you are sending it to includes Spam classification of the email and whether the reason you are not seeing the email is because the email looks "spammy".
There are no definitive answers for what is "spammy" since it is a game between spammers and those don't want spam. You provide no details of what/how you are sending, so I shall guess these could be the reasons why your test email is perhaps been quarantined by a spam classifier:
- the domain you are (apparently) sending from is not bonefide
- you send very little text or suspect content
- you send only text or only HTML variations of the message
- you have no technical measures in place to minimise Spam classification: SPF, DKIM, DMARC
- your sending IP is blacklisted, or least not trusted
I would try sending to an alternate email address that is not processed by a server with any/the same spam protection.
2/5
Top Answer
Answered Sep 01, 2015 · 1 votes
Problem is you are not updating your password.Below line will not update your password.it will just add parameter to parameter collection.
using (SqlCommand cmd = new SqlCommand("Update AspNetUsers set PasswordHash=@Password WHERE Email=@Email")) { cmd.Parameters.AddWithValue("@Password", newPasswordHash); }
use the below code
using (SqlConnection con = new SqlConnection(constr)) { using (SqlCommand cmd = new SqlCommand("Update AspNetUsers set PasswordHash=@Password WHERE Email=@Email")) { cmd.Parameters.AddWithValue("@Email", txtEmail.Text.Trim()); cmd.Parameters.AddWithValue("@Password", newPasswordHash); cmd.Connection = con; con.Open(); int row=cmd.ExecuteNonQuery(); if(row==1) { //success } else { //failed } } }
3/5
Top Answer
Answered Jun 15, 2023 · 0 votes
I personally use rest_framework_simplejwt to generate a token and send an email with a URL and token to the email from forgot password request. Then on that new URL I submit the new password and decode the token to get the user and change the password.
User Model
Here you have access to the refresh and access token but what we want is the access token.
from django.db import modelsfrom django.contrib.auth.models import ( AbstractBaseUser, BaseUserManager, PermissionsMixin)from rest_framework_simplejwt.tokens import RefreshTokenimport uuidclass User(AbstractBaseUser, PermissionsMixin): public_id = models.CharField( max_length=255, default=uuid.uuid4, editable=False, unique=True) username = models.CharField(max_length=60, unique=True) email = models.EmailField(max_length=50, unique=True) firstname = models.CharField(max_length=250, null=False) lastname= models.CharField(max_length=250, null=False) password = models.CharField(max_length=250, null=False) is_superuser = models.BooleanField(default=False) is_verified = models.BooleanField(default=False) is_active = models.BooleanField(default=True) last_login = models.DateTimeField(null=True) created_at = models.DateTimeField(auto_now_add=True, null=False) USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['username', 'firstname', 'lastname'] def __str__(self): return self.username+'( '+self.email+' )' def tokens(self): refresh = RefreshToken.for_user(self) return { 'refresh': str(refresh), 'access': str(refresh.access_token) } class Meta: db_table = 'users' ordering = ('-id',)
Forgot Password View
You can replace localhost:8000/set-password/ with reverse URL to your set password endpoint. Once a user is found, a token is generated and sent to users email.
class RequestPasswordResetEmail(generics.GenericAPIView): serializer_class = ResetPasswordEmailRequestSerializer def post(self, request, *args, **kwargs): try: user = User.objects.get(email=request.data['email']) token = RefreshToken.for_user(user).access_token absurl = "localhost:8000/set-password/?token="+str(token) htmly = get_template('emailTemplates/forgotPassword.html') context = {'firstname': user.firstname, "absurl": absurl} html_content = htmly.render(context) msg = EmailMessage(subject='Password Reset', body=html_content, to=[user.email], from_email=os.environ['EMAIL_SEND_AS']) msg.content_subtype = "html" msg.send() data = {'status': status.HTTP_200_OK, 'msg': 'Email Sent.'} except User.DoesNotExist: data = {'status': status.HTTP_200_OK, 'msg': 'Email Sent.'} return HttpResponse(json.dumps(data))
Set Password View
The token is decoded to get the user id and user password changed otherwise a correct response is given.
class SetAccountPasswordAPIView(generics.RetrieveAPIView): serializer_class = EmailVerificationSerializer def get(self, request): token = request.GET.get('token') try: payload = jwt.decode( token, settings.SECRET_KEY, algorithms='HS256') user = User.objects.get(id=payload['user_id']) user.set_password(request.data['password']) user.save() return Response({'message': 'Password Set Successfully'}, status=status.HTTP_200_OK) except jwt.ExpiredSignatureError: return Response({'message': 'Token Has Expired'}, status=status.HTTP_400_BAD_REQUEST) except jwt.exceptions.DecodeError: return Response({'message': 'Invalid Token'}, status=status.HTTP_400_BAD_REQUEST)
4/5
Top Answer
Answered Aug 31, 2016 · 0 votes
The best possible way to do it would be to use Font Awesome icons and set the font with with vw
font-size:4vw;-
Doing this will reduce the icon size depending on the Width.
OR
Why don't you try keeping the content in a Table. And give the table width in percentage. And Use media queries to place them as required.
OR
You can have 2 different tables for different screen size. And switch visibility using media queries.
5/5
www.makeuseof.com › email-stopped-syncing-android-fixWhy Did Email Stop Syncing on Android? 8 Ways to Fix It - MUO
www.makeuseof.com › email-stopped-syncing-android-fix4 days ago · Quick Links. Ensure Automatic Email Sync Is Enabled. Perform a Manual Email Sync. Clear Your Android Device's Storage. Ensure You Enter the Correct Password on All Your Devices. Clear the Cache and Data. Update Your Email App. Re-Add the Account (s) to Your Email App. Enable Email Notifications.
www.geeksforgeeks.org › how-to-factory-reset-yourHow to Factory Reset Your Gmail - GeeksforGeeks
www.geeksforgeeks.org › how-to-factory-reset-your2 days ago · Step 7: Select ‘Delete Gmail’. Once you’re sure you want to proceed, click on the “Delete Gmail” or “Remove Gmail” button to confirm. After confirming the deletion, Gmail will begin the process of resetting your account.
People also ask
How to reset Gmail password?
- In the first part, we will show you how to reset Gmail password by using your Recovery email. It will only work if you have setup a recovery email before locking out. If you have setup a recovery email then simply use these steps to reset your Gmail Password. Step 1. Head on to Gmail.com and click on "I Forgot My Password ". Step 2.
How to Reset Gmail Password on Computer If Forgot
www.iseepassword.com/forgot-gmail-password.htmlHow do I Change my Gmail com password?
- Scroll to “Server Settings” and tap “Incoming Settings” or “Outgoing Settings” to modify these account settings. You can change the username and password for your accounts, the server name, port and security type for the account’s IMAP server and SMTP server. How do I reset my IMAP Gmail com password? Step 1: Open up the Settings application.
How do I find my IMAP password? - TimesMojo
www.timesmojo.com/how-do-i-find-my-imap-password/How do I remove my Gmail account from my phone?
- On your device, you'll first need to remove your email account from the app. Use the on-screen instructions in the app to do that, if you aren't using Gmail. Alternatively, you can head to Settings > Accounts and backup > Manage account, tap an account, and choose Remove account to take it off your phone.
Why Did Email Stop Syncing on Android? 8 Ways to Fix It - MUO
www.makeuseof.com/email-stopped-syncing-android-fix/How do I Sync my Gmail account?
- Here's what you need to do: Launch your email app, such as Gmail. Tap the hamburger icon (the three-line button) in the top-left corner and select Settings . Choose an email account, if you have multiple accounts on your phone. Scroll down and ensure that you have toggled on the slider for Sync Gmail or a similar option.
Why Did Email Stop Syncing on Android? 8 Ways to Fix It - MUO
www.makeuseof.com/email-stopped-syncing-android-fix/answers.microsoft.com › en-us › outlook_comTrying to add Gmail to Outlook 2021 stalls at Microsoft ...
answers.microsoft.com › en-us › outlook_com3 days ago · Choose to manually configure mailbox-IMAP-select to enter your account name-password, enter in the server settings. Enter the server information in the server settings: Server type: IMAP - Incoming mail server: imap.gmail.com - Outgoing mail server: smtp.gmail.com. Configuration is complete, restart OUTLOOK. 2. Use POP3 setting:
iboysoft.com › news › apple-mail-not-syncing-gmailApple Mail not Syncing with Gmail, Why & How to Fix? - iBoysoft
iboysoft.com › news › apple-mail-not-syncing-gmail4 days ago · Fix 1: Restart your device. Ninety percent of problems can be solved by rebooting your device. Some unknown errors on your iPhone may be the culprit of the Gmail account not syncing with Mac mail problem. So what you need to do is simply restart it, and check your mail to see if the issue is fixed.
www.youtube.com › watchHow to Find Your Gmail Password on Your Phone - YouTube
www.youtube.com › watch1 day ago · In this video, we'll guide you through the process of recovering or finding your Gmail password directly from your mobile device.👉 (FoneTool)https://prf.hn/...
- 2 min
- Space Media Mastery
quartzmountain.org › article › how-to-check-spectrumHow To Access Spectrum Email While Traveling | QuartzMountain
quartzmountain.org › article › how-to-check-spectrum19 hours ago · Go to the Spectrum email login page and enter your email address and password. Once you're logged in, click on the settings icon in the top-right corner of the screen. It looks like a gear or a cogwheel. In the settings menu, click on the "Mail" tab or option. This will take you to the mail settings page.
www.pcrisk.com › removal-guides › 29901-error-inError In Your IMAP/POP3 Mails Server Scam - Removal and ...
www.pcrisk.com › removal-guides › 29901-error-in2 days ago · Check the sender's ("from") email address: Hover your mouse over the "from" address and check if it's legitimate. For example, if you received an email from Microsoft, be sure to check if the email address is @microsoft.com and not something suspicious like @m1crosoft.com, @microsfot.com, @account-security-noreply.com, etc.
Searches related to reset your password mail server gmail mobile email