mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
Check at least if url is a guid, better to check if model exists but
that's not working
This commit is contained in:
parent
2fa58da27e
commit
2620b25ffb
2 changed files with 7 additions and 4 deletions
|
|
@ -77,9 +77,10 @@ view.fn("silver", function(num) {
|
|||
});
|
||||
|
||||
get('/:userId?', function(page, model, _arg) {
|
||||
var userId;
|
||||
var debuggingUsers, userId;
|
||||
userId = _arg.userId;
|
||||
if (userId != null) {
|
||||
debuggingUsers = parseInt(userId) < 40;
|
||||
if ((userId != null) && (Guid.isGuid(userId) || debuggingUsers)) {
|
||||
model.set('_session.userId', userId);
|
||||
return getRoom(page, model, userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,8 +49,10 @@ get '/:userId?', (page, model, {userId}) ->
|
|||
# Saved session
|
||||
# TODO: this doesn't check that the user at guid exists, and
|
||||
# will probably error since no user is created. Will only happen if
|
||||
# first access, but still
|
||||
if userId?# and model.get(userId)?
|
||||
# first access, but still. model.get(userId) and model.get("users.#{userId}") aren't
|
||||
# working for some reason
|
||||
debuggingUsers = (parseInt(userId) < 40) #these are users created before guid was in use, need to convert them to guid and get rid of this
|
||||
if userId? and (Guid.isGuid(userId) or debuggingUsers)# and model.get(userId)?
|
||||
model.set '_session.userId', userId
|
||||
return getRoom page, model, userId
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue