Skip to content

Implement user onboarding with cashu token in query parameters #90

@sh1ftred

Description

@sh1ftred

Description

Add functionality to onboard users automatically when they visit the chat app with a cashu token provided in the query parameters, along with support for a prompt parameter to pre-populate the chat interface.

Requirements

  • Parse cashu token from URL query parameters (e.g., ?cashu=token_value)
  • Parse prompt from URL query parameters (e.g., ?prompt=your_message_here)
  • Support combined parameters (e.g., ?cashu=token_value&prompt=your_message_here)
  • Validate the cashu token format and authenticity
  • Automatically create/setup user account using the cashu token
  • Handle token redemption process
  • Pre-populate chat interface with the provided prompt message
  • Provide user feedback during onboarding process
  • Handle error cases (invalid token, expired token, etc.)
  • Redirect user to appropriate chat interface after successful onboarding

Acceptance Criteria

  • Users can visit chat.routstr.com with ?cashu=<token> and be automatically onboarded
  • Users can visit chat.routstr.com with ?prompt=<message> to pre-populate the chat
  • Users can visit chat.routstr.com with ?cashu=<token>&prompt=<message> for combined functionality
  • Invalid or expired tokens show appropriate error messages
  • Successful onboarding redirects to the main chat interface with prompt pre-populated (if provided)
  • Token is consumed/redeemed during the onboarding process
  • Prompt parameter is URL-decoded and properly displayed in the chat interface

Technical Notes

  • Consider security implications of token handling
  • Ensure proper error handling and user experience
  • May need integration with cashu wallet/mint functionality
  • Implement proper URL encoding/decoding for prompt parameter
  • Handle special characters and long prompts appropriately

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions