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 155 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
8a466a7
Added userID
NikkelM Jan 27, 2024
79e5d66
Moved userID generation to config
NikkelM Jan 27, 2024
302f81e
Fixed test
NikkelM Jan 27, 2024
3ba5eb9
Import crypto
NikkelM Jan 27, 2024
88eef61
Fixed tests
NikkelM Jan 27, 2024
4f2c92f
Fallback if crypto is not available
NikkelM Jan 27, 2024
930699e
Include firestore stripe integration
NikkelM Jan 29, 2024
f64ae6d
Added payments.js
NikkelM Jan 29, 2024
87bbad0
Added oauth requirements
NikkelM Jan 29, 2024
b61193c
Added rudimentary Shuffle+ button
NikkelM Jan 29, 2024
a31ad5d
Added Shuffle+ html page
NikkelM Jan 29, 2024
9e9938f
Added shufflePlus.js, login button
NikkelM Jan 29, 2024
44a8898
Use new auth logic using Google Cloud Functions
NikkelM Jan 29, 2024
fa7a9d3
Get a refresh and access token from GCF
NikkelM Jan 30, 2024
5a894d0
Removed unused code
NikkelM Jan 31, 2024
77dd82d
Renamed variable, restructured dictionary
NikkelM Jan 31, 2024
8a6b358
Save oauth data in local storage, expiresOn as timestamp
NikkelM Feb 2, 2024
782fcf0
Fixed order
NikkelM Feb 2, 2024
4a344f6
First working version of login to Firebase using credentials from Goo…
NikkelM Feb 2, 2024
727ed60
Login to Firebase
NikkelM Feb 3, 2024
8d4268d
Completed sign-in flow, save refresh token in database, use Firestore…
NikkelM Feb 3, 2024
5a7510b
Deduplicated code
NikkelM Feb 3, 2024
9678062
Removed return statement
NikkelM Feb 3, 2024
5ce7ff0
Return authenticated user info, responsive html page
NikkelM Feb 3, 2024
4e7db82
Updated texts
NikkelM Feb 3, 2024
e72d2e0
Fixed redirect URI for Firefox, updated manifest
NikkelM Feb 3, 2024
a0eea5b
Refactored code for clarity and conciseness
NikkelM Feb 3, 2024
b36d1c4
Fixed html responsiveness to login
NikkelM Feb 3, 2024
d0aae88
Removed unknown manifest key for chromium
NikkelM Feb 3, 2024
8d08839
Fixed redirect uri for Firefox
NikkelM Feb 3, 2024
347d2fc
Updated TODOs
NikkelM Feb 3, 2024
4f4f710
Updated comment
NikkelM Feb 5, 2024
c59a04e
Added comment
NikkelM Feb 5, 2024
a462c19
Merge branch 'main' into shuffle-plus
NikkelM Mar 28, 2024
66f7cb7
Updated lockfile
NikkelM Mar 28, 2024
3d80703
Moved googleOauth info to sync storage
NikkelM Mar 28, 2024
da64add
Made login button more responsive
NikkelM Mar 28, 2024
fa8da6d
Updated indendation, sync storage interaction
NikkelM Mar 28, 2024
03a0918
Fixed changelog button logic
NikkelM Mar 28, 2024
6299b5c
Removed resolved TODO
NikkelM Mar 28, 2024
048752b
Added descriptive error messages when login fails
NikkelM Mar 28, 2024
b13bb90
Added additional error handling
NikkelM Mar 28, 2024
5905347
Renamed and split googleOauth and stripe payment logic
NikkelM Mar 28, 2024
e7ce566
Updated imports
NikkelM Mar 28, 2024
e652460
Moved common config objects
NikkelM Mar 29, 2024
cba563d
Fixed shuffle hints
NikkelM Mar 29, 2024
109253b
Added text after successful login
NikkelM Mar 29, 2024
a7efab3
Added an animated effect to the Shuffle+ button, changed button order
NikkelM Mar 29, 2024
e9da709
Added Shuffle+ button to all pages
NikkelM Mar 29, 2024
a18849b
Added error handling if the user closes the auth window
NikkelM Mar 29, 2024
d162c69
Removed TODO
NikkelM Mar 30, 2024
6665cf6
Updated TODO's
NikkelM Mar 30, 2024
3f105f3
Added functionality for the user to remove app access
NikkelM Mar 30, 2024
2491254
Added logic for forgetting a user and revoking app access
NikkelM Mar 30, 2024
56255e1
Fixed revoking access with expired access token
NikkelM Mar 30, 2024
0485588
Added confirmation popup before forgetting user account
NikkelM Mar 30, 2024
2a7d139
Fixed deleting user account in a session without a previous login
NikkelM Mar 30, 2024
0253776
Updated description
NikkelM Mar 30, 2024
71fa986
Fixed infinite loop if no refresh token is available
NikkelM Mar 30, 2024
ec11fe4
Added first working stripe checkout with test data
NikkelM Mar 30, 2024
4cc77a2
Updated test checkout flow with new data format
NikkelM Mar 31, 2024
06e4e45
Also delete user entry, only delete if no active subscription
NikkelM Mar 31, 2024
7adc25d
Fetch products and prices by currency
NikkelM Mar 31, 2024
402aef6
Added some basic information about current subscriptions
NikkelM Mar 31, 2024
2cadb4f
Refactored getUser, user access
NikkelM Mar 31, 2024
4c5bbe3
Enforce semicolons
NikkelM Apr 1, 2024
c61eddd
Fixed getProducts defaulting to USD, more configuration for opening c…
NikkelM Apr 1, 2024
b285ef6
Updated TODO
NikkelM Apr 1, 2024
717bfab
Fixed access rights in Firestore
NikkelM Apr 1, 2024
578c4e8
Refactored subscription UI
NikkelM Apr 1, 2024
57c6e19
Include Checkout ID in redirects
NikkelM Apr 1, 2024
c228177
Updated subscribe button to redirect to customer portal if there is a…
NikkelM Apr 1, 2024
ea81045
Enforce braces
NikkelM Apr 1, 2024
1da7282
Updated payment methods
NikkelM Apr 1, 2024
c376166
Updated getSubscriptionStatus
NikkelM Apr 1, 2024
9e640dc
Formatting
NikkelM Apr 1, 2024
cb70423
Removed comment
NikkelM Apr 1, 2024
7dce384
Added a loading overlay
NikkelM Apr 1, 2024
ff15ecc
Added claim role checks
NikkelM Apr 1, 2024
84c5a9d
Fixed login message after logging out and in again
NikkelM Apr 1, 2024
9131b1b
Added privacy policy
NikkelM Apr 1, 2024
179dab3
Updated getUser arguments, added getGrantedOauthScopes
NikkelM Apr 2, 2024
82b1845
Enforce double quotes
NikkelM Apr 2, 2024
46631be
Update text if user never had an active subscription
NikkelM Apr 2, 2024
8216a9f
Fixed getUser
NikkelM Apr 2, 2024
d5bfc62
Update button text when setting up payment link
NikkelM Apr 2, 2024
8d7042f
Refactored getUser to return complete Oauth object
NikkelM Apr 2, 2024
da4ce18
npm install
NikkelM Apr 5, 2024
6083517
Only get active prices
NikkelM Apr 5, 2024
35a2af4
Fixed userInfo being undefined
NikkelM Apr 5, 2024
6e76647
npm install
NikkelM Apr 5, 2024
cc874b6
Use recurringInterval
NikkelM Apr 6, 2024
fe7578b
Removed duplicate .active check
NikkelM Apr 6, 2024
aee4646
Fixed firebase initialization, update action item if subscribed to sh…
NikkelM Apr 6, 2024
0b5dd44
Fixed firebase version conflicts
NikkelM Apr 6, 2024
6c5cf7c
Allow unused variables starting with _
NikkelM Apr 6, 2024
3d2081d
Made checking the subscription status a message handler command
NikkelM Apr 6, 2024
cbdafa2
Changed back how checking subscription status works
NikkelM Apr 6, 2024
d57933f
Upgrade firebase
NikkelM Apr 11, 2024
b1c41ce
Updated review and donation banner thresholds
NikkelM Apr 11, 2024
25bb4a7
Formatting
NikkelM Apr 11, 2024
d351931
Updated GitHub social image
NikkelM Apr 13, 2024
6c38ee9
Formatting
NikkelM Apr 13, 2024
09cfc2c
Added rough list of benefits
NikkelM Apr 13, 2024
6d3fa0c
Formatting
NikkelM Apr 13, 2024
6068cae
Updated the shuffle+ button animation if the user is already subscribed
NikkelM Apr 13, 2024
3867ed1
Merge branch 'main' into shuffle-plus
NikkelM May 24, 2024
6a17511
Updated beta versioning
NikkelM May 24, 2024
389946c
Updated changelog
NikkelM May 24, 2024
e6db4d5
Fixed typo
NikkelM May 24, 2024
49a8b87
npm install
NikkelM May 24, 2024
6cc69fa
Added first Shuffle+ hint
NikkelM May 24, 2024
ee4643a
Typos, formatting
NikkelM May 24, 2024
45a971c
Updated comment
NikkelM May 24, 2024
7bab36c
Merge branch 'main' into shuffle-plus
NikkelM May 24, 2024
57f2a1c
Merge branch 'main' into shuffle-plus
NikkelM May 25, 2024
c325562
Formatting
NikkelM May 25, 2024
e8ce99c
Merge branch 'main' into shuffle-plus
NikkelM May 26, 2024
7e211c1
Added settings sync with Firestore for logged in users, removed unnec…
NikkelM May 28, 2024
7e8266b
Only sync individual settings to save bandwidth, don't sync all settings
NikkelM May 28, 2024
63651ba
Updated TODO
NikkelM May 28, 2024
542cf74
Merge branch 'main' into shuffle-plus
NikkelM May 29, 2024
b4f9b88
Merge branch 'main' into shuffle-plus
NikkelM May 31, 2024
feb9991
npm install
NikkelM May 31, 2024
ee9d42b
Merge branch 'main' into shuffle-plus
NikkelM Jun 15, 2024
d67156b
npm audit fix
NikkelM Jun 21, 2024
69c5c9d
Highlight button
NikkelM Jun 21, 2024
a888e3a
Fixed redirect links, currency issues
NikkelM Jun 21, 2024
79248f9
Get user currency, added currency selector (no usage yet)
NikkelM Jun 22, 2024
476cb86
Added first version of pricing overview
NikkelM Jun 23, 2024
c9fc472
Fixed spelling
NikkelM Jun 23, 2024
21b726e
Added slider to switch between plan intervals
NikkelM Jun 23, 2024
8c4d0fd
Only change icon if user is subscribed
NikkelM Jun 23, 2024
9621310
Prettier list
NikkelM Jun 23, 2024
f5b8fc5
Removed subscribe functionality from old button
NikkelM Jun 23, 2024
d902ca8
User lowercase currency symbols, new subscription button logic
NikkelM Jun 23, 2024
f364266
Merge branch 'main' into shuffle-plus
NikkelM Jun 24, 2024
d68c73d
Merge branch 'main' into shuffle-plus
NikkelM Jun 25, 2024
a05c794
Updated changelog
NikkelM Jun 26, 2024
6aabd10
Updated default sync setting
NikkelM Jun 26, 2024
bc3d137
Updated feature list
NikkelM Jun 26, 2024
8b17392
Merge branch 'main' into shuffle-plus
NikkelM Jun 26, 2024
5750aaa
Merge branch 'main' into shuffle-plus
NikkelM Jun 26, 2024
3d3fc18
Updated changelog
NikkelM Jun 28, 2024
6977e7c
Merge branch 'main' into shuffle-plus
NikkelM Jun 30, 2024
8352288
Fixed tests
NikkelM Jun 30, 2024
7eae446
Merge branch 'main' into shuffle-plus
NikkelM Jun 30, 2024
eba4aa5
Merge branch 'main' into shuffle-plus
NikkelM Jul 1, 2024
f7a07da
Merge branch 'main' into shuffle-plus
NikkelM Jul 3, 2024
0f46660
Fixed imports, linter
NikkelM Jul 3, 2024
3362fd0
Merge branch 'main' into shuffle-plus
NikkelM Jul 4, 2024
bc0b31a
Linting
NikkelM Jul 4, 2024
ec81922
Merge branch 'main' into shuffle-plus
NikkelM Jul 9, 2024
cb7b7e5
Merge branch 'main' into shuffle-plus
NikkelM Jul 23, 2024
38677a3
Merge branch 'main' into shuffle-plus
NikkelM Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": {
"browser": true,
"node": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"env": {
"browser": true,
"node": true,
"webextensions": true,
"mocha": true
},
"rules": {
"@typescript-eslint/no-var-requires": 0
}
}
},
"rules": {
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-unused-vars": ["warn", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
"semi": ["error", "always"],
"curly": "error",
"quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }]
}
}
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
# Changelog

## v3.1.11
## v4.0.0-beta

<!--Releasenotes start-->
- Introducing Shuffle+, a new way to shuffle, with more customization options than ever before.
- Subscribe to Shuffle+ to gain access to exclusive new features, taking your shuffling experience to the next level.
- You can find a list of all features on the new 'Shuffle+' page in the extension popup.
- Sign in to the extension with your YouTube account, save your preferences and settings across devices and enable new features by giving access to your subscriptions and watched videos.
- The extension icon will now reflect your Shuffle+ subscription status.
- A number of improvements to the maintainability of the extension's codebase.
- Fixed the progress percentage displayed on the button when ignoring or only shuffling from shorts.
<!--Releasenotes end-->

## v3.1.11

- Changed the default settings to not open shuffled videos in a new tab.
- Moved the informative text about remaining YouTube API quota to the advanced settings menu.
- Updated the welcome page for a better experience.
<!--Releasenotes end-->

## v3.1.10

Expand Down
40 changes: 40 additions & 0 deletions PRIVACY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Privacy Policy
This privacy policy governs your use of the "Random YouTube Video" (hereby, "app", "extension") browser extension, developed by NikkelM (hereby, "we", "us", "our", "developer).

# What information does the app obtain and how is it used?
During normal usage, the app does not collect any personal information, and does not store any personal data in any form.

The app offers the option to sign up for a user account using third-party providers, such as, but not necessarily limited to, Google.
Choosing a third-party provider to sign up for an account is optional, and not required to use the basic functionality of the app.
When you sign up for an account using a third-party provider, the app collects and stores information provided by the third-party provider, such as, but not necessarily limited to, your name and email address.
All information that is shared by the third-party provider with the app is disclosed to you during the sign-up process.
The information collected is used to provide the functionality of the app, and for no other reason.

If you choose to subscribe to a paid plan, the app will collect and store payment information through Stripe, a third-party payment processor.
After payment concludes, the app will store information about your subscription, such as, but not necessarily limited to, the subscription plan and the subscription status, as well as identifiers to link this data to your payment identity with Stripe.
This data is collected with the sole purpose of identifying your subscription status, and subsequently providing you with the functionality of the app.
If you have any questions about the handling of your information during the payment process, please refer to Stripe's privacy policy.

# Do third parties see and/or have access to information obtained by the app?
The app utilizes the third-party payment processor Stripe to handle payments for subscriptions.
During this process, Stripe may collect and store information about your payment identity, such as, but not necessarily limited to, your name, email address, and payment information, such as credit card details.

# Data Retention Policy
Personal data collected by the app as described above is stored as long as you have an active account with the app.
If you choose to delete your user account, the app will delete personal data it collected.

Non-linkable data may be stored for longer amounts of time.

# Security
We are concerned about safeguarding the confidentiality of your information.
We limit access to this information to authorized employees who need access to the information in order to operate, develop or improve the app.
Please be aware that, although we endeavor to provide reasonable security for information we process and maintain, no security system can prevent all potential security breaches.
If you are concerned about your data related to payment processing, please refer to the Stripe privacy policy.

# Changes to the Policy
This privacy policy may be updated from time to time for any reason.
We will notify you of any changes to our Privacy Policy by posting the new Privacy Policy here.
You are advised to consult this Privacy Policy regularly for any changes, as continued use is deemed approval of all changes.

# Contact
If you have any questions regarding this privacy policy or your usage of the app, or have questions about our practices, please contact us via email at contact[at]nikkelm.dev.
Binary file modified development/images/github/social_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified development/images/github/social_preview.xcf
Binary file not shown.
Loading
Loading