분명 전에는 storage 에 저장이 잘 됐었는데.. 내가 뭘 건드렸는지 url에 뜬다
음..
https://supabase.com/docs/reference/javascript/auth-signinwithoauth
Sign in a user through OAuth | Supabase
Log in an existing user via a third-party provider. This method supports the PKCE flow.
supabase.com
여기를 참고해야하는 건 알겠는데..
Supabase client를 생성 후 바로 onAuthStateChange 콜백을 등록해야한다고 하는데.
이렇게 문제가 안 풀릴수록 더 기본적이고 개념적인 부분을 점검해야한다고 생각한다.
그런 의미에서, 콜백이 뭘까.
프로그래밍에서 콜백(callback) 또는 콜백 함수(callback function)는 다른 코드의 인수로서 넘겨주는 실행 가능한 코드
를 말한다. 콜백을 넘겨받는 코드는 이 콜백을 필요에 따라 즉시 실행할 수도 있고, 아니면 나중에 실행할 수도 있다.
출처 위키백과
.
.
.
짠!
24시간이 넘게 지나서야 해결했다.
근데 이게 해결이라고 하는게 맞는건지 잘 모르겠는게
그냥 리다이렉트에서의 경로를 로컬호스트메인에서 '/guestbook' 바꿨더니 동작을 한다.
- src/service/supabase.ts
export async function signInOAuthUser(){
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
options:{
redirectTo: 'http://localhost:3000/guestbook',
queryParams:{
access_type: 'offline',
prompt: 'consent',
},
},
});
}
- Authentication > URL Configurations
- Google Cloud Platfrom > Console > API & Services > Credentials > Client ID for Web application
.
.
.
으음.. 이거 해결하려고 여기 저기 다 뒤졌는데,, 도커까지 깔았는데,,
일단 왜 되는지는 완성하고 생각해야겠다.
'TroubleShooting' 카테고리의 다른 글
[ Git ] private repository 클론 시 not found 뜨는 에러 (0) | 2024.03.06 |
---|---|
useEffect 와 관련해서 문제가 생겼다 (0) | 2024.02.01 |
Error : Event handlers cannot be passed to Client Component (feat. 직렬화 serialize) (0) | 2024.01.19 |
환경변수가 안 불러와진다? (0) | 2024.01.19 |
[ Next.js ] Error: next-image-unconfigured-host (0) | 2024.01.08 |