fix: review comments

This commit is contained in:
Stavros
2025-12-26 18:55:08 +02:00
parent eef674a4e6
commit 80121f2a36
2 changed files with 7 additions and 20 deletions

View File

@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"net/http"
"strconv"
"time"
"github.com/steveiliop56/tinyauth/internal/config"
@@ -27,6 +28,7 @@ type GithubEmailResponse []struct {
type GithubUserInfoResponse struct {
Login string `json:"login"`
Name string `json:"name"`
ID int `json:"id"`
}
type GithubOAuthService struct {
@@ -172,9 +174,7 @@ func (github *GithubOAuthService) Userinfo() (config.Claims, error) {
user.PreferredUsername = userInfo.Login
user.Name = userInfo.Name
// Github does not implement OIDC, so no sub is available
user.Sub = "not_available_dont_use_me"
user.Sub = strconv.Itoa(userInfo.ID)
return user, nil
}