MbinOrg / mbin

Mbin: a federated content aggregator, voting, discussion and microblogging platform (By the community, for the community)
https://joinmbin.org
GNU Affero General Public License v3.0
222 stars 17 forks source link

Registering with Authentik SSO gives 500 Internal Error #823

Closed saiwal closed 3 months ago

saiwal commented 3 months ago

Describe the bug While trying to register/login using Authentik SSO, mbin gives an internal error (500)

On which Mbin instance did you find the bug? https://forums.utsukta.org (Own instance)

Which Mbin version was running on the instance? 1.6.0

To Reproduce Steps to reproduce the behavior:

  1. Enable authentik SSO.
  2. Click on login with authentik.
  3. See error

php container shows the following error message: mbin-php | {"message":"Uncaught PHP Exception TypeError: \"substr(): Argument #3 ($length) must be of type ?int, bool given\" at AuthentikAuthenticator.php line 99","context":{"exception":{"class":"TypeError","message":"substr(): Argument #3 ($length) must be of type ?int, bool given","code":0,"file":"/var/www/mbin/src/Security/AuthentikAuthenticator.php:99"}},"level":500,"level_name":"CRITICAL","channel":"request","datetime":"2024-06-13T11:14:58.670356+00:00","extra":{}}

Expected behavior A new user should be created and an existing user should be logged in.

Screenshots image

Desktop (please complete the following information):

ghost commented 3 months ago

strpos seems to be returning false (bool):

image

when substr expects an int (or null):

image

@CocoPoops are you able to investigate this? If not, that's ok... I can, but figured I'd ask since you submitted the Authentik PR https://github.com/MbinOrg/mbin/pull/806 and I don't have an Authentik setup readily available.

CocoPoops commented 3 months ago

šŸ¤¦ whoops forgot to test registering a new account anyway #824 should fix this i have tested in on my own instance

ghost commented 3 months ago

@CocoPoops no worries, thank you!

@saiwal can you pull down the latest main branch and see if this issue is resolved?

saiwal commented 3 months ago

@nobodyatroot yes thankyou! this fixed it. works fine now. :)