Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted January 4, 20178 yr 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.
January 4, 20178 yr You might want to ping @onlyME or @CodingJungle to see if they have any suggestions
January 4, 20178 yr 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 }
January 4, 20178 yr Author 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?
January 4, 20178 yr Author 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.
January 4, 20178 yr 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.
Archived
This topic is now archived and is closed to further replies.