Giter Club home page Giter Club logo

Comments (3)

gregfrasco avatar gregfrasco commented on June 17, 2024

I have written code to do that before but didn't make it in.

frame/server/api/login.js

Lines 87 to 108 in 9e5a5b9

assign: 'existingSession',
method: function (request, reply) {
const userAgent = Useragent.lookup(request.headers['user-agent']);
const ip = request.info.remoteAddress;
const browser = userAgent.family;
const os = userAgent.os.toString();
Session.findOne({
userId: request.pre.user._id.toString(),
ip,
browser,
os
}, (err, session) => {
if (err) {
return reply(err);
}
return reply(session);
});
}

from frame.

jedireza avatar jedireza commented on June 17, 2024

Yeah we should add this. One thing I would add... let's not use the ip as part of the unique identifier for the device. For example my phone is the same browser/session but can be on multiple IPs per day.

from frame.

jedireza avatar jedireza commented on June 17, 2024

In the next version of Frame I've simplified session handling a bit. I've removed the revoked property from sessions and also decided (for now) not to include any restoring session logic (this issue) by default.

I intend for Frame to be generic. This results in less opinions forced on other people and also less to maintain. For example; we're using hapi-auth-basic which I don't recommend that anyone use. In 100% of my use cases I remove hapi-auth-basic as almost the first step. In some cases hapi-auth-cookie with keep alive configured has a really good session retention experience for me.

Thanks again for getting involved.

from frame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.