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

feat: Logout from the extension #138

Merged
merged 3 commits into from
May 26, 2023
Merged

feat: Logout from the extension #138

merged 3 commits into from
May 26, 2023

Conversation

Anush008
Copy link
Member

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Description

This PR includes three changes:

  • Added an option to log out from the application.
  • Limited the extension host permissions in the manifest.json file.
  • Set the maximum description length to 500 characters.

Generated using OpenSauced.

The utility functions added to support logout/login have been prefixed with opt to distinguish as auth-utility functions called on explicit user actions and not on events like onInstalled or onStartUp.

export const optLogOut = () => {
void chrome.storage.sync.remove(OPEN_SAUCED_AUTH_TOKEN_KEY);
void chrome.storage.local.set({ [OPEN_SAUCED_OPTED_LOG_OUT_KEY]: true });
};
export const optLogIn = () => {
if (typeof window === "undefined") {
return;
}
void chrome.storage.local.set({ [OPEN_SAUCED_OPTED_LOG_OUT_KEY]: false });
window.open(SUPABASE_LOGIN_URL, "_blank");
};
const hasOptedLogOut = async (): Promise<boolean> => (await chrome.storage.local.get(OPEN_SAUCED_OPTED_LOG_OUT_KEY))[OPEN_SAUCED_OPTED_LOG_OUT_KEY] === true;

The max description length has been set to 500 in accordance to the API constraints.
https://github.com/open-sauced/api.opensauced.pizza/blob/e55f963aa4f3fda34440fc035d45776d244408eb/src/pull-requests/dtos/create-pull-request-description.dto.ts#L5-L13

Related Tickets & Documents

Resolves #116, #102.

Mobile & Desktop Screenshots/Recordings

Untitled

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“œ README.md
  • πŸ““ docs.opensauced.pizza
  • πŸ• dev.to/opensauced
  • πŸ“• storybook
  • πŸ™… no documentation needed

@Anush008 Anush008 requested review from bdougie and diivi May 26, 2023 16:11
@Anush008 Anush008 linked an issue May 26, 2023 that may be closed by this pull request
2 tasks
Copy link
Member

@bdougie bdougie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving but want to point out we should start testing everything in the utils folder.

#135

Copy link
Contributor

@diivi diivi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested this out, but code looks good.

@bdougie bdougie merged commit 1f62f0e into beta May 26, 2023
github-actions bot pushed a commit that referenced this pull request May 26, 2023
## [1.3.0-beta.2](v1.3.0-beta.1...v1.3.0-beta.2) (2023-05-26)

### πŸ• Features

* Logout from the extension ([#138](#138)) ([1f62f0e](1f62f0e))
@github-actions
Copy link

πŸŽ‰ This PR is included in version 1.3.0-beta.2 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

github-actions bot pushed a commit that referenced this pull request May 27, 2023
## [1.3.0](v1.2.0...v1.3.0) (2023-05-27)

### πŸ• Features

* adds test and lint to build ([#127](#127)) ([6f1cfc7](6f1cfc7))
* Logout from the extension ([#138](#138)) ([1f62f0e](1f62f0e))

### βœ… Tests

* setup tests ([#139](#139)) ([8d61ab0](8d61ab0))

### πŸ› Bug Fixes

* run builds on PRs ([a755e38](a755e38))
@github-actions
Copy link

πŸŽ‰ This PR is included in version 1.3.0 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

@Anush008 Anush008 deleted the logout branch May 29, 2023 15:01
zer0and1 added a commit to zer0and1/open-sauced.ai that referenced this pull request Jul 26, 2023
## [1.3.0-beta.2](open-sauced/ai@v1.3.0-beta.1...v1.3.0-beta.2) (2023-05-26)

### πŸ• Features

* Logout from the extension ([#138](open-sauced/ai#138)) ([1f62f0e](open-sauced/ai@1f62f0e))
zer0and1 pushed a commit to zer0and1/open-sauced.ai that referenced this pull request Jul 26, 2023
## [1.3.0](open-sauced/ai@v1.2.0...v1.3.0) (2023-05-27)

### πŸ• Features

* adds test and lint to build ([#127](open-sauced/ai#127)) ([6f1cfc7](open-sauced/ai@6f1cfc7))
* Logout from the extension ([#138](open-sauced/ai#138)) ([1f62f0e](open-sauced/ai@1f62f0e))

### βœ… Tests

* setup tests ([#139](open-sauced/ai#139)) ([8d61ab0](open-sauced/ai@8d61ab0))

### πŸ› Bug Fixes

* run builds on PRs ([a755e38](open-sauced/ai@a755e38))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Sign out of the extension Feature: Limit permissions for the extension to GitHub
3 participants