SilverStripe 4.1-不遵守SS_DEFAULT_ADMIN_USERNAME和PASSWORD [英] SilverStripe 4.1 - SS_DEFAULT_ADMIN_USERNAME and PASSWORD not respected

查看:132
本文介绍了SilverStripe 4.1-不遵守SS_DEFAULT_ADMIN_USERNAME和PASSWORD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu Vagrant VM上运行了SilverStripe 4.1站点(从3.4升级).我有以下.env文件:

I have a SilverStripe 4.1 site (upgraded from 3.4) running on an Ubuntu Vagrant VM. I have the following .env file:

# Default Admin
SS_DEFAULT_ADMIN_USERNAME="admin"
SS_DEFAULT_ADMIN_PASSWORD="password"

# DB credentials
SS_DATABASE_CLASS="MySQLPDODatabase"
SS_DATABASE_SERVER="127.0.0.1"
SS_DATABASE_USERNAME="user"
SS_DATABASE_PASSWORD="pass"
SS_DATABASE_NAME="silverstripe"

# environment
SS_ENVIRONMENT_TYPE="dev"

该网站可以正常工作,并且在删除.env时会抱怨,因此该网站正在读取它.

The site otherwise works, and complains when .env is deleted, so it's being read by the site.

但是,当我进入/admin并使用上面的管理员用户名和密码登录时,登录页面会刷新并显示以下消息:

However, when I go to /admin to log in with the above admin username and password the login page just refreshes with this message:

您必须登录才能访问管理区域;请在下面输入您的凭据.

You must be logged in to access the administration area; please enter your credentials below.

我尝试将.env文件移动到其他位置.多个dev/build?flush=all,即登录页面本身上的flush=all,并手动删除/tmp中的silverstripe缓存.屏幕上或日志中没有错误.

I've tried moving the .env file to different locations. Multiple dev/build?flush=all, a flush=all on the login page itself and manually deleting the silverstripe cache in /tmp. There are no errors on screen or in the logs.

任何人以前都曾遇到过此问题,或者可以猜出是什么原因导致的,或者我如何在日志中捕获任何错误?

Has anyone had this issue before, or can guess what may be causing this, or how I might trap any errors in a log?

推荐答案

问题出在网站上的客户端cookie.更新后,cookie中的某些内容一定不正确,从而导致登录信息永远不会转到正确的管理URL.

The issue was the client side cookies on the site. Something in the cookies must have been incorrect after the update, causing the log in to never go to the correct admin URL.

使用隐身浏览器标签(或其他浏览器)可以正常工作,表明需要清除Cookie.我清除了域Cookie,然后登录再次正常工作.

Using an incognito browser tab (or another browser) worked correctly, showing that the cookies needed to be cleared. I cleared my domain cookies and then the log in worked correctly again.

这篇关于SilverStripe 4.1-不遵守SS_DEFAULT_ADMIN_USERNAME和PASSWORD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆