mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-09 07:13:35 -05:00
[PR #1177] [CLOSED] fix: prevent runtime.TypeAssertionError in openid provider parsing #1301
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/go-vikunja/vikunja/pull/1177
Author: @Copilot
Created: 7/25/2025
Status: ❌ Closed
Base:
main← Head:copilot/fix-1175📝 Commits (2)
31a733aInitial planbeb8968fix: prevent runtime.TypeAssertionError in openid provider parsing📊 Changes
1 file changed (+10 additions, -4 deletions)
View changed files
📝
pkg/modules/auth/openid/providers.go(+10 -4)📄 Description
Problem
The application was crashing with a
runtime.TypeAssertionErrorwhen parsing OpenID Connect provider configurations:This occurred in
pkg/modules/auth/openid/providers.goat line 58, where the code was making an unsafe type assertion assuming that if a provider configuration wasn't amap[string]interface{}, it must be amap[interface{}]interface{}. However, misconfigured or malformed provider configs could result in other types like[]interface{}, causing the application to panic.Solution
Added proper type checking before the type assertion:
Impact
/infoendpoint and other OpenID functionality now handle invalid provider configurations gracefullyThe fix ensures that even with malformed OpenID provider configurations, the application continues to run and provides useful error information for debugging.
Fixes #1175.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.