Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google OAuth, Shuffle+, Firebase Auth, Payment processing using Stripe #273

Draft
wants to merge 160 commits into
base: main
Choose a base branch
from

Merge branch 'main' into shuffle-plus

e7026b2
Select commit
Loading
Failed to load commit list.
Draft

Google OAuth, Shuffle+, Firebase Auth, Payment processing using Stripe #273

Merge branch 'main' into shuffle-plus
e7026b2
Select commit
Loading
Failed to load commit list.
Todo PR Checker / Todo PR Checker failed Jan 28, 2025 in 4s

✘ 24 unresolved action items found!

There are 24 unresolved action items in this Pull Request:

Details

CHANGELOG.md (1 action item):

<!-- TODO: Test if the tabs permission is required for the sign-in flow page etc. -->
- Removed "tabs" permission from the extension, enhancing privacy.

src/background.js (2 action items):

// TODO: If the user has not yet been introduced to Shuffle+, open the introduction page
// Use a config flag to do so
// TODO: Find other things that would better be stored in session storage
// Store the user's country code and local currency in session storage

src/config.js (2 action items):

// TODO: Add a toggle in the popup. TODO on that: When the setting gets toggled on, sync all syncable settings to Firestore immediately. When turned off, remove all settings from Firestore
"plusSyncSettings": false
// TODO: Add hints for Shuffle+
export const shufflingHints = [

src/googleOauth.js (6 action items):

// TODO: If there is a user and an active subscription, fetch a new access token in the background script on startup, and validate the subscription status
console.log("Getting user info.");
// TODO: Make sure we can have access to the YouTube account auto-ticked in the Google Oauth flow, or get notified if the user didn't do so so we can notify them afterwards and reprompt
async function googleLogin(allowSelfRevoke = true) {
// TODO: Refactor to separate function
let redirectUri;
// TODO: Use this to check if the user has granted the youtube scope before we can enable features using it
// TODO: Not used at the moment
export async function getGrantedOauthScopes() {
// TODO: If there is no active subscription, remove all user data from Firebase
// We always remove the refreshToken, as it is no longer active

src/html/shufflePlus.js (4 action items):

// TODO: Change default
const defaultProductName = "Shuffle+ (Test)";
// TODO: Make manage button only (behaviour)
// Subscribe button
// TODO: Use correct product name
let requestedProduct = "Shuffle+ (Test)";
// TODO: This is the test URL
const url = `https://billing.stripe.com/p/login/test_7sI5lw95Afu5fzqbII?prefilled_email=${user.userInfo.email}`;

src/stripe.js (4 action items):

// TODO: Proper success URL, cancellation URL. Redirect to either Github or nikkelm.dev, if redirecting to extension is not possible?
//chrome runtime URL's are not valid for Stripe
// TODO: Handle error
}
if (url) {
// TODO: Decide whether to open a new tab or redirect the current tab
hasOpenedCheckoutTab = true;
// TODO: Save if role exists in session storage?
export async function userHasActiveSubscriptionRole(user = null) {

static/html/shufflePlus.html (4 action items):

<!-- TODO: If the width is too low, move this to a second row (prevent overlapping with currency selector) -->
<h2>Shuffle+ benefits</h2>
<!-- TODO: Implement features -->
<li>Shuffle from your subscriptions or <b>multiple channels</b> at once (coming soon)</li>
<!-- TODO: Open an overlay while logging in, or waiting for the stripe flow to complete, asking the user to follow instructions, and in case fo Stripe, reload page afterwards -->
<!-- TODO: Make this a manage button only -->
<!-- Manage subscription/Subscribe button -->

static/html/welcome.html (1 action item):

<!-- TODO: Update welcome page with Shuffle+ information -->
<body id="randomYoutubeVideoBody">

Did I do good? Let me know by helping maintain this app!