oauth.db.ts 380 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
2
3
4
5
6
7
8
9
10
11
12
import { Oauth, IOauth } from "../models";

export const createSocialKey = async (socialKeys: IOauth) => {
  const newOauth = new Oauth({
    socialType: socialKeys.socialType,
    REST_API_KEY: socialKeys.REST_API_KEY,
    REDIRECT_URI: socialKeys.REDIRECT_URI,
    CLIENT_SECRET_KEY: socialKeys.CLIENT_SECRET_KEY,
  });
  const oauth = await newOauth.save();
  return oauth;
};