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

Add support for OAuth login #1122

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

Add support for OAuth login #1122

wants to merge 20 commits into from

Conversation

SferaDev
Copy link
Member

@SferaDev SferaDev commented Aug 7, 2023

No description provided.

Signed-off-by: Alexis Rico <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Aug 7, 2023

🦋 Changeset detected

Latest commit: 6c6cc61

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@xata.io/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Aug 11, 2023

Your pull request has been published to npm.

You can install @xata.io/client by running:

npm install @xata.io/[email protected]

Other packages are published like this:

npm install @xata.io/[email protected]

To test the CLI, run:

npx @xata.io/[email protected]

@github-actions
Copy link
Contributor

github-actions bot commented Aug 11, 2023

size-limit report 📦

Path Size
packages/client/dist/index.mjs 15.77 KB (0%)
packages/client/dist/index.cjs 16.9 KB (0%)
packages/codegen/dist/index.mjs 1.95 MB (0%)
packages/codegen/dist/index.cjs 1.95 MB (0%)

SferaDev and others added 13 commits August 11, 2023 11:21
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Co-authored-by: SferaDev <[email protected]>
Co-authored-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
@SferaDev SferaDev marked this pull request as ready for review August 22, 2023 06:54
@SferaDev SferaDev requested a review from a team as a code owner August 22, 2023 06:54
@SferaDev SferaDev marked this pull request as draft August 22, 2023 06:54
@SferaDev SferaDev marked this pull request as ready for review November 27, 2023 11:57
@SferaDev SferaDev requested a review from eemmiillyy November 27, 2023 11:58
eemmiillyy
eemmiillyy previously approved these changes Nov 27, 2023
}

async getXataClient({ profile }: { profile?: Profile } = {}) {
if (this.#xataClient) return this.#xataClient;

const { apiKey, host } = profile ?? (await this.getProfile());

if (!apiKey) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we still check whether the token is an empty string and log that error?

const currentProfile = await this.getProfile();
const domain = web || currentProfile?.web || 'https://app.xata.io';

return await loginWithWebUI(domain);
Copy link
Contributor

Choose a reason for hiding this comment

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

We no longer give them the option to create a new API key during login, it's done automatically on login now?

import { BaseCommand } from '../../base.js';
import { readCredentialsDictionary, saveCredentials } from '../../credentials.js';

export default class Refresh extends BaseCommand<typeof Refresh> {
Copy link
Contributor

Choose a reason for hiding this comment

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

When is this called?

cli/src/auth-server.ts Outdated Show resolved Hide resolved
@SferaDev SferaDev requested a review from eemmiillyy November 27, 2023 15:13
@SferaDev SferaDev dismissed eemmiillyy’s stale review November 27, 2023 15:13

Dismissing until we test it thoroughly

@SferaDev SferaDev marked this pull request as draft November 28, 2023 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants