Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Tech
  3. nodebb-plugin-sso-google Remove the dash in username

nodebb-plugin-sso-google Remove the dash in username

Scheduled Pinned Locked Moved Tech
15 Posts 2 Posters 26 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • bh4-tech@community.nodebb.orgB This user is from outside of this forum
    bh4-tech@community.nodebb.orgB This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #6

    @julian The mastodon and pixelfed profile mentions work fine. I am attaching the screenshot of what opens when I click on the pixelfed profile link. 1000071804.png

    1 Reply Last reply
    0
    • julian@community.nodebb.orgJ This user is from outside of this forum
      julian@community.nodebb.orgJ This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #7

      @bh4-tech interesting, since they don't look linked to me. However I don't have a Threads account, so I'm not logged in.

      Can you screenshot your post?

      1000007466.png

      1 Reply Last reply
      0
      • bh4-tech@community.nodebb.orgB This user is from outside of this forum
        bh4-tech@community.nodebb.orgB This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #8

        @julian I guess it's not linked since you don't have account on threads. The screenshot is attached.1000071808.png

        1 Reply Last reply
        0
        • julian@community.nodebb.orgJ This user is from outside of this forum
          julian@community.nodebb.orgJ This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #9

          @bh4-tech can you test with another account with a dash? I wonder if it's capturing the bh4 because there is an Instagram account with that handle.

          1 Reply Last reply
          0
          • julian@community.nodebb.orgJ This user is from outside of this forum
            julian@community.nodebb.orgJ This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #10

            Also you know what it could be, is that this site is blocked by Threads, so that's why the link might not match.

            1 Reply Last reply
            0
            • bh4-tech@community.nodebb.orgB This user is from outside of this forum
              bh4-tech@community.nodebb.orgB This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #11

              @julian community.nodebb.org is blocked by threads but my nodebb instance isn't . For my nodebb server also, usernames with dash cannot be mentioned while others can be(screenshot attached).
              1000071809.png

              Also, a dash in username doesn't look nice and we do not have much control over remote servers(like threads). So, please suggest me a way in which new users can be created with google-sso plugin without a dash.

              1 Reply Last reply
              0
              • julian@community.nodebb.orgJ This user is from outside of this forum
                julian@community.nodebb.orgJ This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #12

                @bh4-tech you will have to modify src/slugify.js so that the generated slug contains no dashes.

                1 Reply Last reply
                0
                • bh4-tech@community.nodebb.orgB This user is from outside of this forum
                  bh4-tech@community.nodebb.orgB This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #13

                  @julian Thanks, will try and let you know.

                  1 Reply Last reply
                  0
                  • bh4-tech@community.nodebb.orgB This user is from outside of this forum
                    bh4-tech@community.nodebb.orgB This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #14

                    @julian src/slugify.js requires public/src/modules/slugify, so I changes the slugify function in that file to

                    return function slugify(str, preserveCase) {
                    		if (!str) {
                    			return '';
                    		}
                    		str = String(str).replace(trimRegex, '');
                    		if (isLatin.test(str)) {
                    			str = str.replace(invalidLatinChars, '_');
                    		} else {
                    			str = XRegExp.replace(str, invalidUnicodeChars, '_');
                    		}
                    		str = !preserveCase ? str.toLocaleLowerCase() : str;
                    		str = str.replace(collapseWhitespace, '_');
                    		str = str.replace(collapseDash, '_');
                    		str = str.replace(trimTrailingDash, '');
                    		str = str.replace(trimLeadingDash, '');
                    		return str;
                    	};
                    

                    , basically replaced the dashes with underscore. I then stopped my current instance, upgraded it and then started it. However, now I registered a user using the google-sso plugin and again it has a dash in username instead of underscore. I guess we need to log the username somewhere in the plugin/core nodebb to find the problem. Which would be the best place for doing so?

                    1 Reply Last reply
                    0
                    • bh4-tech@community.nodebb.orgB This user is from outside of this forum
                      bh4-tech@community.nodebb.orgB This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #15

                      @bh4-tech My editing was correct but there was some problem with git on my server. I have fixed the things and now google registered users are having underscore in username instead of dash and can also be followed and mentioned from threads.
                      @julian The problem is solved and thanks a lot for the support.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups