Oh Dear is the all-in-one monitoring tool for your entire website. We monitor uptime, SSL certificates, broken links, scheduled tasks and more. You'll get a notifications for us when something's wrong. All that paired with a developer friendly API and kick-ass documentation. O, and you'll also be able to create a public status page under a minute. Start monitoring using our free trial now.

Making 1Password understand where your change password page is located

Original – by Freek Van der Herten – 2 minute read

A few days ago, a new version of 1Password was released that is able to detect where a user can reset his or her password.

This is how it looks like in 1Password:

screenshot

When you click that "Change password" item, 1Password will open up a tab in your browser on the right page at Oh Dear to change the password.

screenshot

This is pretty convenient if you ask me.

1Password knows where the change password page is located using the "Well-Known URL for Changing Passwords" specification. This specification tells that a request to <your-domain>/.well-known/change-password should redirect to the change password pass on your site.

So, behind the scenes, 1Password simply requests /.well-known/change-password and checks if a redirect is made.

In Laravel, you can easily create such a redirect in a routes file.

Route::redirect('/.well-known/change-password', '/url-of-your-change-password-page)

I was tempted to use a closure and the route name, but this code would make the routes uncacheable.

// do not use this if you want to use route caching
Route::get('.well-known/change-password', fn() => redirect()->route('profile.show'));

I can highly recommend adding a /.well-known/change-password redirect to your projects.

Stay up to date with all things Laravel, PHP, and JavaScript.

You can follow me on these platforms:

On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.

Every month I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

Comments

What are your thoughts on "Making 1Password understand where your change password page is located"?

Comments powered by Laravel Comments
Want to join the conversation? Log in or create an account to post a comment.