inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

173만명의 커뮤니티!! 함께 토론해봐요.

App RefreshToken 관리 방법

미해결

안녕하세요 React Native으로 React Query 를 이용해서 소셜로그인 기능을 구현중입니다. 이유는 간단하게 템플릿으로 매 프로젝트 진행할때마다 수월하게 하기 위해서 입니다. RefreshToken을 DB에 넣는편이 좋을까요 안넣는편이 좋을까요? 일반적인 앱 로그인 플로우 차트 알려주시면 감사하겠습니다,, 현재는 keychain으로 넣고 끝입니다.. accessToken 만료 시 2개 토큰 전부 재발급 해주고 있구요.

  • reactnative
  • refreshtoken
  • auth
Dijeung(디증) 댓글 0 좋아요 0 조회수 39

minSdkVersion (firebase_auth) 관련 에러 발생하는 분들 참고하세요

해결됨

Flutter 앱 개발 기초

Flutter version 이 3.22 버전을 사용 중인데, minSdkVersion 에러가 나는 분들이 있을 것입니다. [에러 상황] firebase 프로젝트 준비 및 google-services.json 주입을 마치고, flutter 명령어로 first base에 필요한 패키지를 다운로드 받은 이후의 상황입니다. main.dart 를 실행하는데 아래와 같은 에러가 발생하는 분들은 주목하세요. Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library [:firebase_auth] 위와 같은 에러가 발생하는 분들은 아마 앱 레벨의 build.gradle이 이와 같이 설정되어있을 겁니다. defaultConfig { applicationId = "com.example.bucket_list_with_firebase" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutterVersionCode.toInteger() versionName = flutterVersionName } 위 메시지를 해석하면 firebase_auth가 minSdkVersion이 23 이상을 지원하는데, 현재 너의 프로젝트의 minSdkVersion은 21이 되어있어서 지원이 불가능하다는 메시지입니다. [에러 원인] 이는 flutter sdk에서 android의 minSdkVersion이 21로 설정되어있기 때문에 그렇습니다. 실제로 강의자료에 나와있듯이 flutter sdk의 flutter.groovy 파일을 살펴보면 class FlutterExtension { public final int compileSdkVersion = 34 public final int minSdkVersion = 21 // 다른 변수들 } 이처럼 21 버전을 상수값으로 사용하고 있는 것을 알 수 있습니다. 하지만 firebase의 auth 기능을 사용하려면 minSdkVersion이 23이어야 합니다. [해결 방법] 이를 해결하기 위한 방법은 터미널 로그에 잘 표시되어있습니다. The plugin firebase_auth requires a higher Android SDK version. Fix this issue by adding the following to the file android { defaultConfig { minSdkVersion 23 } } Following this change, your app will not be available to users running Android SDKs below 23. 위에 로그에서 recommend 하듯이 내 flutter project의 minSdkVersion을 바꿔주면 해결됩니다. flutter.minSdkVersion 대신 상수로 23 값을 입력하면 됩니다. defaultConfig { // applicationId minSdk = 23 // 다른 설정 값들 } [해결 완료 후 동작 확인] 아래와 같이 main.dart를 실행하면 로그인 화면이 정상적으로 보여져야 합니다.

  • flutter
  • firebase
  • minsdk
  • minsdkversion
  • auth
  • firebase_auth
bascat 댓글 1 좋아요 2 조회수 1113

heroku run python manage.py createsuperuser / auth_user 오류

미해결

플러터와 장고로 1시간만에 퀴즈 앱/서버 만들기 [무작정 풀스택]

heroku run python manage.py createsuperuser 명령어 작성 시 django.db.utils.OperationalError: no such table: auth_user 위 오류가 계속 뜨며, 진행을 아예 할 수가 없습니다. 구글에서 오류 해결 방안을 최대한 찾아봐 적용해봤지만, 안되네요. 남은 건 그동안 한 거 싹 다 버리고 처음부터 하는 방법밖에 없는 것 같은데. 그러자니 그렇게 되면 안 할 것 같아서. 혹시 저랑 똑같은 오류 나셨는데 해결하신 분 계실까요? 방법 좀 알려주세요.. ㅠㅠ 이틀 째 해결 못하고 있어서 머리털이 다 뽑히고 있습니다..

  • django
  • flutter
  • heroku
  • auth
  • superuser
마령이 댓글 2 좋아요 0 조회수 374

auth 에러에 대해서

해결됨

Next.js 필수 개발 가이드 3시간 완성!

제목 : auth 해보고 있는데 오류가 나오고있네용 설명 : 저는 prisma를 postgresql로 하고있습니다. 그래도 왜 이런 오류가 나오는지 원인은 잘 모르겠네요 내용: auth에서 credentials를 하고 있습니다. import NextAuth from "next-auth"; import CredentialsProvider from "next-auth/providers/credentials"; import KakaoProvider from "next-auth/providers/kakao"; import NaverProvider from "next-auth/providers/naver"; import { PrismaAdapter } from "@auth/prisma-adapter"; import prisma from "@root/src/server/prisma"; import bcrypt from "bcrypt"; export const authOptions = { providers: [ CredentialsProvider({ name: "Credentials", credentials: { accountId: { label: "Username", type: "text" }, password: { label: "Password", type: "password" }, email: { label: "Email", type: "email" }, name: { label: "Name", type: "text" }, }, async authorize(credentials, req) { if (!credentials?.email || !credentials.password) { return null; } const exUser = prisma.user.findUnique({ where: { accountId: credentials.accountId as string, email: credentials.email as string, password: credentials.password, name: credentials.name as string, }, }); if (!exUser) return null; const passwordMatch = await bcrypt.compare( credentials.password as string, exUser.password! // 오류 발생 ); return passwordMatch ? exUser : null; }, }), KakaoProvider({ clientId: process.env.KAKAO_CLIENT_ID!, clientSecret: process.env.KAKAO_CLIENT_SECRET!, }), NaverProvider({ clientId: process.env.NAVER_CLIENT_ID!, clientSecret: process.env.NAVER_CLIENT_SECRET!, }), ], adapter: PrismaAdapter(prisma), }; const handler = NextAuth(authOptions); // authOptions 오류 발생 export { handler as GET, handler as POST }; 이건 제 소스이고, authOptions와 exUser.password! 부분에서 에러가 나오고 있는데 원인을 잘 모르겠습니다. 해당 오류입니다. 'Prisma__UserClient<{ id: string; accountId: string | null; name: string | null; email: string | null; emailVerified: Date | null; image: string | null; phone: string; password: string; role: ROLE; } | null, null, DefaultArgs>' 형식에 'password' 속성이 없습니다.ts(2339) 아래는 authOptions 오류입니다. '{ providers: (CredentialsConfig<Record<string, CredentialInput>> | OAuthConfig<KakaoProfile> | OAuthConfig<...>)[]; adapter: Adapter; }' 형식의 인수는 'NextAuthConfig' 형식의 매개 변수에 할당될 수 없습니다. 'adapter.linkAccount'의 형식은 해당 형식 간에 호환되지 않습니다. '((account: import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/@auth/core/adapters").AdapterAccount) => Promise<void> | import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/@auth/core/types").Awaitable<import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/@aut...' 형식은 '((account: import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/next-auth/node_modules/@auth/core/adapters").AdapterAccount) => Promise<void> | import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/next-auth/node_modules/@auth/core/types").Awaitable<...>) | undefined' 형식에 할당할 수 없습니다. '(account: import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/@auth/core/adapters").AdapterAccount) => Promise<void> | import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/@auth/core/types").Awaitable<import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/@auth...' 형식은 '(account: import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/next-auth/node_modules/@auth/core/adapters").AdapterAccount) => Promise<void> | import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/next-auth/node_modules/@auth/core/types").Awaitable<...>' 형식에 할당할 수 없습니다. 'Promise<void> | import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/@auth/core/types").Awaitable<import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/@auth/core/adapters").AdapterAccount | null | undefined>' 형식은 'Promise<void> | import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/next-auth/node_modules/@auth/core/types").Awaitable<import("/Users/hwangjeong-yeon/workspace/Project/FOCC/focc/node_modules/next-auth/node_modules/@auth/core/adapters").AdapterAccount | null | undefined>' 형식에 할당할 수 없습니다. 'AdapterAccount' 형식은 'Promise<void> | Awaitable<AdapterAccount | null | undefined>' 형식에 할당할 수 없습니다. 'AdapterAccount' 형식에 'Promise<void>' 형식의 then, catch, finally, [Symbol.toStringTag] 속성이 없습니다.ts(2345) const authOptions: { providers: (CredentialsConfig<Record<string, CredentialInput>> | OAuthConfig<KakaoProfile> | OAuthConfig<...>)[]; adapter: Adapter; } 혹시 제가 schema 부분에서 오류가 있을까요? model User { id String @id @default(cuid()) accountId String? name String? email String? @unique emailVerified DateTime? image String? phone String @default("") password String @default("") role ROLE @default(USER) accounts Account[] sessions Session[]

  • typescript
  • next.js
  • auth
황정연 댓글 2 좋아요 1 조회수 625

Auth() 처리 시 Warning: Functions are not valid as a React child 에러 해결방법

미해결

따라하며 배우는 노드, 리액트 시리즈 - 기본 강의

강의 따라했는데 아래 에러 나시는 분들 Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it. 버전이 달라지면서 Auth지원 관련해서 강의와 차이가 생긴 듯 합니다 간단한 해결 방법 입니다 ./src/hoc/auth.js 파일의 Auth함수를 익명함수가 아닌 기명함수로 변경 import { useEffect } from "react"; import { useDispatch } from "react-redux"; import { auth } from "../_actions/user_action"; const Auth = (SpecificComponent, option, adminRoute = null) => { function AuthenticationCheck(props) { const dispatch = useDispatch(); useEffect(() => { dispatch(auth()).then((res) => { console.log(res); }); }, []); return <SpecificComponent />; } return AuthenticationCheck; }; export default Auth; 2. ./src/compoenent/views/RandingPage, LoginPage, RegsterPage export시 Auth 처리 //LendingPage export default Auth(LandingPage, null); //LoginPage export default Auth(LoginPage, false); //RegisterPage export default Auth(RegisterPage, false); 왜인진 모르겠지만 저는 Auth를 익명함수로 두니까 Auth(컴포넌트) 처리시에 계속 에러가 나더라구요 기명함수로 고쳤더니 에러 해결됐습니다

  • auth
  • hoc
  • react
  • nodejs
팀오 댓글 0 좋아요 4 조회수 944

포스트 작성시 token 질문드립니다.

미해결

리액트로 나만의 블로그 만들기(MERN Stack)

안녕하세요, 처음에 포스트 작성이 안되다가 결론은 postWrite.js에서 token값을 넘겨주지 않아서 DB에 데이터가 안들어왔었던 거여서 문제를 해결했습니다. 근데 의문점이 생겨서 질문드려요. 위 문제처럼 token값을 넘겨주지 않아서 포스트 작성이 안됬던것은 서버단에 post.js에 포스트작성 router에서 auth미들웨어를 인자로 받고있는데, 이 미들웨어서 token값을 요구하기 때문에 그런건가용?

  • postWrite
  • redux
  • token
  • nodejs
  • auth
  • mongodb
  • express
  • react
  • bootstrap
Choi 댓글 1 좋아요 0 조회수 231

인기 태그

인프런 TOP Writers

주간 인기글