[3.2][RC] Discord OAuth2 light

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
jackennils
Registered User
Posts: 210
Joined: Mon Jun 01, 2009 7:48 pm

Re: [3.2][RC] Discord OAuth2 light

Post by jackennils » Thu Sep 05, 2019 11:08 am

Does this "register" the Discord user in the forum? Do those people get a regular account when using this ext?

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1106
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [3.2][RC] Discord OAuth2 light

Post by mrgoldy » Thu Sep 05, 2019 2:53 pm

When the user uses an OAuth provider (regardless if it is Discord or any other), it will be prompted with this message:
You have attempted to login with an external service that is not yet connected to an account on this board. You must now either link this account to an existing account or create a new account.
.
Then you have two options:
  1. Log in to your current phpBB account.
  2. Register a new phpBB account.
Which ever is chosen, they can then always login by clicking on the 'Discord OAuth' button.

So yes, they will have a regular/normal phpBB account.

nou nou
Registered User
Posts: 362
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Discord OAuth2 light

Post by nou nou » Thu Sep 05, 2019 6:22 pm

OK so I tried this all over again, deleting data, re-uploading (1.0.3 is the first time I try this extension anyway) and follow your instructions.

Here's the difference between my test board and yours:

When I hover over the Discord button on the login screen at the unreadposts link, this is the link that it goes to:

Image

On your forum, when I hover over the Discord button at the same location, this is the link:

Image


ucp.php rather than search.php. I have no idea what causes that difference, but I'm hoping you might :)

As I said, other login pages work fine, as long as the redirect link is ucp.php something. So the Discord setup works in that sense.

3Di wrote:
Thu Sep 05, 2019 5:09 am
Proof: https://phpbbstudio.com/search.php?sear ... io_discord
Yes, when I click that link, I get the Oauth error from Discord - what does that prove, then?

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1106
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [3.2][RC] Discord OAuth2 light

Post by mrgoldy » Thu Sep 05, 2019 10:57 pm

Ah yes, that was an issue indeed but we fixed it on almost all of our boards ourselves (and that's why we couldn't reproduce it) and made a PR, that is merged into 3.2.8: https://github.com/phpbb/phpbb/pull/5592

User avatar
3Di
Former Team Member
Posts: 14088
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [3.2][RC] Discord OAuth2 light

Post by 3Di » Thu Sep 05, 2019 11:13 pm

jackennils wrote:
Thu Sep 05, 2019 11:08 am
Does this "register" the Discord user in the forum? Do those people get a regular account when using this ext?
To add to what @mrgoldy said, being this the light version, the native procedure for registering/linking a board's user is available indeed though the full versions of our OAuths will be able to effectively register the service's user and much more.
Like it does the Battlenet OAuth Full ext already.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

nou nou
Registered User
Posts: 362
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Discord OAuth2 light

Post by nou nou » Fri Sep 06, 2019 5:09 am

mrgoldy wrote:
Thu Sep 05, 2019 10:57 pm
Ah yes, that was an issue indeed but we fixed it on almost all of our boards ourselves (and that's why we couldn't reproduce it) and made a PR, that is merged into 3.2.8: https://github.com/phpbb/phpbb/pull/5592
Oh great, at least I'm not crazy then ;)

Seeing that 3.2.8 seems just around the corner it's not a very big deal.

Thanks for clarifying!

nou nou
Registered User
Posts: 362
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Discord OAuth2 light

Post by nou nou » Fri Sep 06, 2019 5:10 am

3Di wrote:
Thu Sep 05, 2019 11:13 pm
To add to what @mrgoldy said, being this the light version, the native procedure for registering/linking a board's user is available indeed though the full versions of our OAuths will be able to effectively register the service's user and much more.
I was wondering what the 'light' name was all about...

Any ETA for the full version?

User avatar
3Di
Former Team Member
Posts: 14088
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

[3.2][RC] Discord OAuth2 light

Post by 3Di » Fri Sep 06, 2019 8:25 am

nou nou wrote:
Fri Sep 06, 2019 5:10 am
Any ETA for the full version?
Full versions will be separate and use their own namespace with a proprietary license. See Docs.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

nou nou
Registered User
Posts: 362
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Discord OAuth2 light

Post by nou nou » Sat Sep 07, 2019 4:50 am

The docs say I should ask you, apparently... :mrgreen:

nou nou
Registered User
Posts: 362
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Discord OAuth2 light

Post by nou nou » Mon Sep 09, 2019 8:04 pm

mrgoldy wrote:
Thu Sep 05, 2019 10:57 pm
Ah yes, that was an issue indeed but we fixed it on almost all of our boards ourselves (and that's why we couldn't reproduce it) and made a PR, that is merged into 3.2.8: https://github.com/phpbb/phpbb/pull/5592
Neat, I adjusted that line on my test board and I'm happy to say it all works well now! :)

I have a question. I see you are adjusting the login pages by cleverly injecting a style sheet based on the scope of a certain variable (that's how I understand it)? So far so good, and it works with all the phpbb login forms.

However, I'm running a custom style that adds a convenient login popup that is part of a custom navbar on the index page. What would be the best way to add the stylesheet to any custom but of html like that, which is not part of the standard phpbb login areas?

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1106
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [3.2][RC] Discord OAuth2 light

Post by mrgoldy » Mon Sep 09, 2019 8:32 pm

Kinda hard providing support for something unknown.
If the custom style is still using the phpBB template class you can try including {% INCLUDECSS '@phpbbstudio_dol/phpbbstudio_dol.css' %} in its template file.

nou nou
Registered User
Posts: 362
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Discord OAuth2 light

Post by nou nou » Tue Sep 10, 2019 1:45 pm

mrgoldy wrote:
Mon Sep 09, 2019 8:32 pm
Kinda hard providing support for something unknown.
If the custom style is still using the phpBB template class you can try including {% INCLUDECSS '@phpbbstudio_dol/phpbbstudio_dol.css' %} in its template file.
Fair enough - I was on my phone so I couldn't share code.

I can now, though :)

Here's the code for the login popup:

Code: Select all

<!-- Modal login -->
	<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
	<div class="modal fade" id="loginmodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content cube-bg-1">
				<form method="post" action="{S_LOGIN_ACTION}">
					<div class="modal-header">
				        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="icon-uniE0BE"></i></button> 						
				    </div>
				    
				    <div class="modal-body">
				    	<div class="modal-login-block">
				    		<div class="modal-login-header">
				    			<h2>{L_LOGIN_LOGOUT}</h2>
				    			<a href="{U_REGISTER}" class="small-link">{L_REGISTER}</a>
				    		</div>
				    		<div class="modal-login-content">	
				    			<fieldset class="quick-login">				    		
				    				<div class="mb20">				    					
				    					<input type="text" placeholder="&#xe674" name="username" id="username" size="10" class="inputbox autowidth input-icon" title="{L_USERNAME}" />
				    				</div>
				    				<div class="mb20">				    					
				    					<input placeholder="&#xe688" type="password" name="password" id="password" size="10" class="inputbox autowidth input-icon" title="{L_PASSWORD}" />
				    				</div>

				    				<div class="mb10">	
				    					<a class="op-link" href="{BOARD_URL}ucp.php?mode=sendpassword">{L_FORGOT_PASS}</a>
				    				</div>				    								

				    				<!-- IF S_AUTOLOGIN_ENABLED -->
				    				<div class="mb10">
				    					<label class="op-link" for="autologin">{L_LOG_ME_IN} <input type="checkbox" name="autologin" id="autologin" /></label>
				    				</div>		
				    				<!-- ENDIF -->

				    				<div class="mb20">
				    					<label class="op-link" for="viewonline">{L_HIDE_ME} <input type="checkbox" name="viewonline" id="viewonline" tabindex="5" /></label>
				    				</div>	

				    				<input type="submit" name="login" value="{L_LOGIN}" class="button2" />
				    				{S_LOGIN_REDIRECT}
									{S_FORM_TOKEN_LOGIN}
				    			</fieldset>
				    		</div>
				    	</div>	
					</div>
				</form>	

			</div>
		</div>
	</div>
	<!-- ENDIF -->
<!-- Modal login END-->	
The INCLUDECSS addition doesn't work, I'm guessing a[href$="studio_discord"] needs to be injected based on something that's not present in the above snippet? Or something to that effect?

Thanks!

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1106
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [3.2][RC] Discord OAuth2 light

Post by mrgoldy » Tue Sep 10, 2019 3:52 pm

well, like I said. I / we can / will not really provide support for this.

It seems it's a modal, and those are always tricky with including CSS.
Moreover, the code snippet still uses old phpBB template syntax and not twig.
And it is not using append_sid() to create its URLs (eg. the sendpassword link).
Nor is there any code there that iterates over the available OAuths..

You're best of asking the author of that extension / code, we can not help you with that.

nou nou
Registered User
Posts: 362
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Discord OAuth2 light

Post by nou nou » Tue Sep 10, 2019 4:59 pm

Sure no worries, I totally understand.

The style in question has been abandoned for a while so I've been updating it myself ever since the author disappeared from the face of the earth. I still have to do the conversion to Twig - good reminder... ;)

It's been going well so far but every now and then I run into little things like this. But your pointers are very helpful, I'll figure this one out as well. I may just get rid of the modal and implement one of some other fast login options out there :)

User avatar
3Di
Former Team Member
Posts: 14088
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [3.2][RC] Discord OAuth2 light

Post by 3Di » Tue Sep 10, 2019 10:37 pm

@nou nou:

Please use the "custom coding" or "Wanted!" forums for your coding needs.

If you have issues with this extension we are more than glad to help, but stay on topic.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

Post Reply

Return to “Extensions in Development”