---
# System prepended metadata

title: Petal Account Management App

---

# Petal Account Management App

### Goals and Scope

- Clicking on the "Settings" menu option should open a new tab at `accounts.petal.org`

### Code Organization

- Standalone repository
- React SPA, Material UIdo 

## Centralized authentication flow

> Use `accounts.petal.org/login` and `accounts.petal.org/signup`

- Pass redirect or target service via URL parameters
- Use Google tag manager to track conversions etc. 
- Use this flow to pass JWT to other apps via URL (like how we do Google OAuth2):
   1. Cite requires user to be authenticated, redirects to `accounts.petal.org/login?service=cite`
   2. User complete authentication flow
   3. User is redirected to `cite.petal.org/?token={urlEncodedAuthToken}`
   4. Cite extracts JWT access token from URL and stores in redux

Should work as a popup, iframe, or dedicated page:
- "parent" app should "consume" the redirect event at the end of the flow (like how we handle the Google OAuth2 popup). 
- If standalone page, then no need to consume the redirect, and let it happen naturally.

Considerations for Word Add-in and Browser Extension
- Should work fine
- Need to add a logout dialog to actually logout user on the word addin

JWT Access Token expiration and Refresh Tokens
- Orthogonal issue

How to check if user is deleted when receiving 403 errors:
- Use endpoint to check for user associated with email

## Account Settings

- Public profile
    - Name
- Security
    - Change password
- Email preferences
    - Change email
- Delete account 

## Billing Settings

- Manage subscriptions
- Update billing information
- Pricing plans
- Upgrade flow
- Downgrade flow?
- Handle Stripe redirects?

## Backend Support



## Things to exclude ?

- Manage collections
