[Issue #7] Auth-protected app example #20
Reference in New Issue
Block a user
Delete Branch "issue-7-auth-protected-example"
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?
Summary
This PR adds an example demonstrating OIDC authentication with the Iris framework. The example showcases how to build an auth-protected application using the
authpackage.Changes
examples/auth/main.gowith a complete working example that demonstrates:/profile,/protected) usingnavigation.AuthGuardTest plan
GOOS=js GOARCH=wasm go build ./examples/auth/...Closes #7
Generated with Claude Code
Code Review
Summary
Good OIDC authentication example demonstrating the auth package with login/logout flow, protected routes, and token handling.
Highlights
Issue: Duplicated Route Configuration
Lines 68-93 and 158-183 - The routes array is defined identically in two places:
This violates DRY and could lead to inconsistencies if one is updated but not the other.
Suggested Fix
Extract routes to a function:
Then use
getRoutes()in both places.Minor Notes
Please extract the routes configuration to avoid duplication.
Code Review - Approved
Comprehensive OIDC authentication example with login/logout flow, protected routes, and token handling.
Highlights
navigation.AuthGuardPrevious Feedback
Duplicated route configuration extracted to
getRoutes()function.LGTM - merging.