Skip to content

Add Google Sign-In integration for SolveIt-hosted apps#170

Merged
jph00 merged 2 commits intomainfrom
solve-auth
Mar 15, 2026
Merged

Add Google Sign-In integration for SolveIt-hosted apps#170
jph00 merged 2 commits intomainfrom
solve-auth

Conversation

@ncoop57
Copy link
Copy Markdown
Contributor

@ncoop57 ncoop57 commented Mar 15, 2026

Summary

Adds a new solve_auth module that provides Google Sign-In functionality for apps hosted on SolveIt.

Changes

  • New setup_solve_signin() function to add authentication routes to FastHTML/Starlette apps
  • sub_from_signin() to decode and validate JWT tokens from the auth callback
  • Custom SolveSigninError exception for auth failures
  • Handles redirect flow through SolveIt's auth service at auth.solve.it.com

Minimal fasthtml app using this:

from dialoghelper.solve_auth import *
from fasthtml.common import *
from fasthtml.jupyter import *

app, rt = fast_app()
srv = JupyUvi(app, port=8000)
setup_solve_signin(app)

@rt
def index(): return Titled('Auth Test', A('Sign In with Google', href=solve_signin_rt, cls='button'))

@rt
def signin_completed(session, signin_reply: str=''):
    session['auth'] = sub_from_signin(session, signin_reply)
    return Titled('Signed In!', Pre('Sub ID: ' + session['auth']))

I've tested it out on prod and it worked as expected.

@ncoop57 ncoop57 added the enhancement New feature or request label Mar 15, 2026
@ncoop57 ncoop57 requested a review from jph00 March 15, 2026 21:10
@ncoop57
Copy link
Copy Markdown
Contributor Author

ncoop57 commented Mar 15, 2026

@jph00 how should the deps for this be included? Should they be optional?

@jph00 jph00 merged commit 2516a05 into main Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants