Skip to main content
7 votes

Locked out of my Account, how to get back in?

This is not actually my answer since it's from Andrew Welch on Twitter here: https://mobile.twitter.com/nystudio107/status/1063135843441954816 If you have access to MySQL, you can change the admin ...
John Morton's user avatar
6 votes

/admin/actions/users/login 404

What server provisioner are you using? Forge? Something else? If it's Forge, it's most likely this: https://twitter.com/nystudio107/status/895726366477344772 Also here are some Nginx configs (with ...
andrew.welch's user avatar
  • 11.6k
5 votes
Accepted

/admin/actions/users/login 404

So I looked into this a bunch more tonight to satisfy my curiosity, and here's what is happening. The default rewrite rule that Forge is apparently adding is this: if ($request_uri ~* "^(.*/)index\....
andrew.welch's user avatar
  • 11.6k
5 votes
Accepted

/login page in Craft keeps redirecting to home page. What could be causing that?

/login is the default login page for Craft (see https://craftcms.com/docs/config-settings and scroll down to the users section ). You can override it by adding something like this to your config file: ...
Roi Agneta's user avatar
  • 1,463
5 votes

No craft_users table in Database

There are so many tables that phpMyAdmin paginates them. All the tables that came after craft_tags alphabetically are on the second page, making it look like there is no craft_users table. Pagination ...
Ian Gibbs's user avatar
5 votes
Accepted

Save and login user in a Plugin?

Put this at the top of the file: use craft\elements\User; Within your function use the following code: $user = new User(); $user->pending = true; $user->username = $contact["login_email"]; $...
Matt Shearing's user avatar
5 votes

How to modify the login panel

You can add a logo to the login page by uploading one to Settings → General Login Page Logo. If you need further tweaking, you could use the Control Panel CSS plugin. I wouldn't recommend modifying ...
Oli's user avatar
  • 7,495
4 votes

Users are always logged out on front end

I tracked down a similar problem, and documented it here: The Case of the Missing PHP Session I'm not sure if it'll address the issue you're having specifically, but it may give you some clue on ...
andrew.welch's user avatar
  • 11.6k
4 votes
Accepted

{% requireLogin %} not returning to original page

I may be missing something here, but you probably just want to remove the postLoginRedirect setting from the config? You could also try adding {{ redirectInput(craft.app.user.returnUrl) }} to the form....
dmatthams's user avatar
  • 2,492
4 votes
Accepted

Bad Request Unable to verify your data submission and unstyled CP

There isn't really enough information here to give a full answer, but 'Bad Request Unable to verify your data submission' means that Craft is not getting supplied the correct CSRF token. To confirm, ...
Jeremy Daalder's user avatar
4 votes

How to modify the login panel

I solved this by adding a module that is supposed to act as a sitemodule with different functions I use over most of my projects. Inside that module you register an asset bundle that ultimately adds a ...
MisterMike's user avatar
3 votes
Accepted

setPasswordPath being ignored

Picking this up with another project, it looks like the problem was me not specifying a template path as the 'setPasswordPath' config setting. Instead, I was passing a route. I was doing this because ...
Clive Portman's user avatar
3 votes
Accepted

Auto-login on account activation

(Not necessarily a great answer to your question, but it's in the same wheelhouse and might be handy if you're working in this area)! I remember having issues with this myself (to be honest the ...
Jeremy Daalder's user avatar
3 votes

Autologin destination

Okay - got to the bottom of this. Was using the wrong setting. Should have been setPasswordSuccessPath not setPasswordSuccess!
Cole Henley's user avatar
  • 1,741
3 votes
Accepted

Sometimes getting sent to /admin/undefined after login

This happened for me when I had the LastPass browser plugin version 3.3.1. Once I upgraded to 4.1.29, the issue went away.
Andrew's user avatar
  • 46
3 votes

Restricted front-end access

Sounds like a custom plugin is in order. Your plugin could add a custom {% validateUser %} Twig tag. That tag would check to see if their logged in OR check craft.request.getIpAddress() and validate ...
Brad Bell's user avatar
  • 67.5k
3 votes

Restricted front-end access

Is the physical web server inside your network as well? As mcclaskiem mentioned, check to see if the IP address is within the subnet of your network and then allow access that way. You may want to ...
RitterKnight's user avatar
  • 6,582
3 votes

Protect a page with a single password?

I’ve done this a few times before and this is how I usually get it done. Set Per Entry Password Within Craft create a new Plain Text field for the entry you would like password protected. The ...
noahread's user avatar
3 votes
Accepted

Log in User (Craft 3)

Documentation for this can be found in Craft's class reference. # Login as user, by id Craft::$app->getUser()->loginByUserId($user->id); # Redirect return Craft::$app->getResponse()->...
Paul's user avatar
  • 6,338
3 votes
Accepted

Limit DevMode to admin users?

The goal for enabling dev mode so I can troubleshoot things while not showing those ugly errors to anyone else. If that's all you're looking for, there is a per-user account setting for this under ...
Brad Bell's user avatar
  • 67.5k
3 votes
Accepted

CORS preflight check failing for AJAX login form on different domain

Thanks for posting your headers, that was very helpful. I experienced a very similar problem just the other day and was able to work it out via trial and error and a whole bunch of Google/...
Dalton Rooney's user avatar
3 votes

CraftCMS admin login page error "Account Suspended"

Unfortunately this is an all too common occurrence. The good news is this is fixable. If your account was suspended, you need to unsuspend it. Typically you'd do this on the backend of the site. If ...
RitterKnight's user avatar
  • 6,582
3 votes
Accepted

"Unable to verify your data submission" error when logging into Craft Control Panel

As part of my troubleshooting, I checked the Developer Console and saw a couple errors originating from Craft's javascript files that were stored in the /cpresources directory. As an attempted fix, I ...
Anna_MediaGirl's user avatar
3 votes
Accepted

Moved site to new server and can't login

Well, it's finally figured out by something that I never thought of before this. It was based on sessions not working correctly. This was because there is a php.ini file in the root folder with this ...
Michael's user avatar
  • 41
2 votes

$allowAnonymous = true - not working

If the cron jobs are triggered at the server where your Craft installation is hosted, it might be better to implement a consolecommand instead to execute the logic you want. They are well suited for ...
24HOURSMEDIA's user avatar
2 votes

Logging out users - logoutPath & logoutUrl

I use a little hack using the retour plugin to redirect request to login page. It's no longer maintained but it's fully working on Craft CMS 2.x versions. You need to install this plugin and set new ...
Dominik Krulak's user avatar
2 votes

Password protect whole staging site. Redirect to original page not working

{% requireLogin %} is intended for use with your own login form on the frontend rather than the standard /admin one. From the docs for loginPath: The URI Craft should use for user login on the ...
Clive Portman's user avatar
2 votes
Accepted

CSRF admin Login

the CSRF field its a hidden field not part of the form attributes. You don't have to manually type it, craft twig comes with {{ getCsrfInput() }} that recreates a hidden field between the <form><...
Xpertbot's user avatar
  • 191
2 votes
Accepted

How can I check a user has completed a field in their profile after log in?

If you have a front end form for user registration then you should mark the fields as required in the CMS, you can then make use of Crafts form validation. I had a project where we imported user ...
Luke Pearce's user avatar
  • 3,863
2 votes

Front end login form with ajax

I had a same problem and I will try to give you more detailed explanation. Craft thinks you submitted a classic login form and Users controller tries to redirect you after successful login. In case ...
Duško Šobić's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible