8000 🐛 Bug Report: GitHub OAuth2 Not Working SvelteKit · Issue #5858 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
🐛 Bug Report: GitHub OAuth2 Not Working SvelteKit #5858
Closed as not planned
Closed as not planned
@bitlogist

Description

@bitlogist

👟 Reproduction steps

import { ID, Permission, Role } from 'appwrite'
import type { Models } from 'appwrite'
import { get, writable } from 'svelte/store'
import { sdk, server } from '$lib/appwrite/appwrite'

export type State = {
  account: Models.User<Models.Preferences> | null
}

const createState = () => {
  const { subscribe, set, update } = writable<State>({
    account: null,
  })

  return {
    // ...
    oAuth: async (provider: string, redirectURL: string) => {
      sdk.account.createOAuth2Session(provider, redirectURL) // have no idea how to get user information

      const urlParams = new URLSearchParams(window.location.search)
      const code = urlParams.get('code')

      console.log(code) // nothing
    }
  }
}

export const state = createState()
// ...
<IconButton on:click={() => state.oAuth('github', `https://${data.hostname}`)}></IconButton>
// ...

👍 Expected behavior

I should be able to access the user's GitHub details. The createOAuth2Session function does not return anything.

👎 Actual Behavior

OAuth and redirection was successful but no code parameter was passed onto my application.

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Linux

🧱 Your Environment

  • TypeScript
  • SvelteKit
  • Web SDK
  • Gitpod
  • Vercel

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingproduct / authFixes and upgrades for the Appwrite Auth / Users / Teams services.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0