• HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Get in touch
    Get in touch
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    • Sign in
    • Start free trial
    • Get in touch
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    • Documentation
      • Home
      • Read API
      • Write API
      • Plugin Development
    1. Home
    2. gingerman
    3. Topics
    G
    • Profile
    • Following 4
    • Followers 0
    • Topics 2
    • Posts 12
    • Best 3
    • Controversial 0
    • Groups 1

    Topics created by gingerman

    • G

      JWT Authentication for Write API from Mobile App / Web App
      NodeBB Plugins • • gingerman

      6
      0
      Votes
      6
      Posts
      3793
      Views

      Samurais

      Even use cookie is possible to make an mobile application, but the server should provide api to verify username and password and return cookie value for this session. And the mobile then set the cookie for following requests.

      I give it a sample for iOS platform.

      // set cookie storage NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; CDVPluginResult * result = nil; NSString *appUrl = [command.arguments objectAtIndex:0]; NSString *appCookie = [command.arguments objectAtIndex:1]; if (appUrl != nil && [appUrl length] > 0 && appCookie != nil && [appCookie length] > 0) { NSArray *cookieArray = [appCookie componentsSeparatedByString:@";"]; for (NSString *cookieItem in cookieArray) { NSMutableDictionary *cookieDict = [NSMutableDictionary dictionary]; NSRange range = [cookieItem rangeOfString:@"connect.sid="]; if (range.location != NSNotFound){ NSString *cookieValue = [cookieItem substringFromIndex:(range.location + range.length)]; //domainCookie = [cookieItem stringByAppendingString:domainRapidApps]; //[cookieDict setObject:domainCookie forKey:NSHTTPCookieValue]; NSURL *url = [NSURL URLWithString:[appUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSString *domain = [url host]; // set cookie [cookieDict setObject:@"connect.sid" forKey:NSHTTPCookieName]; [cookieDict setObject:cookieValue forKey:NSHTTPCookieValue]; [cookieDict setObject:domain forKey:NSHTTPCookieDomain]; [cookieDict setObject:@"/" forKey:NSHTTPCookiePath]; [cookieDict setObject:@"0" forKey:NSHTTPCookieVersion]; NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:cookieDict]; [cookieStorage setCookie:cookie]; } }
    • G

      Doubts before migrating a forum to NodeBB
      General Discussion • doubts feature • • gingerman

      8
      0
      Votes
      8
      Posts
      4445
      Views

      wzrdtales

      @baris Yes I use Redis for NodeBB, so it gets applied to the integrated socket.io. But also it seems like I misinterpreted the problem for some reasons...

      Several features are not working with clustering, for example the chat:
      I can open it, but...
      http://puu.sh/d1vZq/0a3f135134.png
      As you see in this screenshot, sometimes I get the messages and sometimes I don't.

      Or the plugins, I can initiate installation and nothing happens but the image changes. Installation through the ACP just don't work with clustering. I haven't tested it yet together with websockets, as I'm a cloudflare customer and haven't got access to the websockets right now.

    Get Started

    • Product
    • Pricing

    Resources

    • Demo Site
    • Answers
    • Docs
    • Bug Bounty

    Company

    • About
    • Blog
    • Contact
    Start Free Trial
    Github Facebook Instagram Twitter
    © 2014 – 2022 NodeBB, Inc. — Made in Canada.
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact
    Menu
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact