feat: add support for multiple access token provider

This commit is contained in:
tdurieux
2021-09-06 09:43:26 +02:00
parent cbbc43f280
commit ebf104750e
4 changed files with 10 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ export default class User {
}
get accessToken(): string {
return this._model.accessToken;
return this._model.accessTokens.github;
}
get photo(): string {

View File

@@ -2,7 +2,9 @@ import * as mongoose from "mongoose";
const { Schema } = mongoose;
const UserSchema = new Schema({
accessToken: String,
accessTokens: {
github: { type: String },
},
username: {
type: String,
index: { unique: true },

View File

@@ -1,7 +1,9 @@
import * as mongoose from "mongoose";
export interface IUser {
accessToken: string;
accessTokens: {
github: string;
};
username: string;
email: string;