Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
inkredible Posted January 4, 2017 Posted January 4, 2017 Hello, I would like to write an own chat application using an external node.js server. For this purpose I want to "authenticate" users serversided. I thought it would be the best to send the user's cookie along with the initial connection. I am not experienced with the IPB framework though and hence I wonder how I can get the user's cookie and how I can decrypt the cookie on my node.js server. Also: Is there a documentation about all existent IPB classes? All what I have found until now are forum posts about the existent IPB classes and it's members. Best regards, Inkredible.
Joel R Posted January 4, 2017 Posted January 4, 2017 You might want to ping @onlyME or @CodingJungle to see if they have any suggestions
bfarber Posted January 4, 2017 Posted January 4, 2017 The cookies will be member_id and pass_hash, and then you can compare this against the values stored for the member. $member = \IPS\Member::load( (int) \IPS\Request::i()->cookie['member_id'] ); if ( $member->member_login_key AND \IPS\Request::i()->cookie['pass_hash'] AND \IPS\Login::compareHashes( (string) $member->member_login_key, (string) \IPS\Request::i()->cookie['pass_hash'] ) ) { // Member is valid }
inkredible Posted January 4, 2017 Author Posted January 4, 2017 1 hour ago, bfarber said: The cookies will be member_id and pass_hash, and then you can compare this against the values stored for the member. $member = \IPS\Member::load( (int) \IPS\Request::i()->cookie['member_id'] ); if ( $member->member_login_key AND \IPS\Request::i()->cookie['pass_hash'] AND \IPS\Login::compareHashes( (string) $member->member_login_key, (string) \IPS\Request::i()->cookie['pass_hash'] ) ) { // Member is valid } Thanks for the snippet. Can you also answer my second question regarding the documentation of all IPB classes and it's members?
bfarber Posted January 4, 2017 Posted January 4, 2017 I'm afraid there's no phpdoc printout at this time unfortunately.
inkredible Posted January 4, 2017 Author Posted January 4, 2017 2 hours ago, bfarber said: I'm afraid there's no phpdoc printout at this time unfortunately. What should I do in order to find specific members / classes? I am not very familiar with large php projects, so maybe I am not aware of a possiblity to inform myself about the classes.
teraßyte Posted January 4, 2017 Posted January 4, 2017 This might be a good starting point: https://invisionpower.com/developers/ Other than that you'll have to post more specific questions on what you want to do in the development forum and we can try to help.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.