我在谷歌应用引擎上有一个 webapp,它检查用户是否使用以下代码登录(通过联合 ID)。我刚刚更改了域名,现在由于某种原因它无法识别我当前的任何用户。这是因为 openID 会根据我通过一些测试找到的域名而变化。是否有任何解决方法或方法可以让这些用户登录?
user = users.get_current_user()
currentregistereduser = None
try:
user_db_qry = User.query(User.theid == user.federated_identity())
user_db_list = user_db_qry.fetch(1)
currentregistereduser = user_db_list[0]
# I go on here to do all of the stuff for a logged in user
#if the user does not exist yet
except IndexError:
logging.error("indexerror" + str(User.theid) + " and " + str(user.federated_identity()))
user_db = User(
name=user.nickname(),
email=user.email(),
theid=user.federated_identity(),
visits = 0,
medals = 0,
prestige = 1,
)
user_db.put()
#they go on to create their profile data here
self.redirect("/profile")