import { Component, OnInit, Input } from '@angular/core';
import { passport } from 'passport';
import { Strategy } from 'passport-github';
@Component({
selector: 'app-Callback',
templateUrl: './Callback.component.html',
styleUrls: ['./Callback.component.css']
})
export class CallbackComponent implements OnInit {
constructor(){}
getAuth(){
passport.authenticate('github');
}
ngOnInit(): void {
var GitHubStrategy = Strategy.Strategy;
passport.use(new GitHubStrategy({
clientID: "56e8d8ca33270722d3b0",
clientSecret: "73934a7c16258220808d4b9e22abd379d0c25cc3",
}, function(accessToken, refreshToken, profile, cb) {
return cb(null, profile);
}
));
// passport.serializeUser(function(user, cb) { // cb(null, user);
// });
// passport.deserializeUser(function(obj, cb) {
// cb(null, obj);
this.getAuth();
}
}