Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/middlewares/authenticated.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export const customAuthenticator = async (req, res, next) => {
export const authSuccess = (req, res) => {
const data = {
username: req.user.username,
tokens: req.user.accounts
tokens: req.user.accounts,
avatar: req.user.githubProfile._json.avatar_url
};
const token = Buffer.from(JSON.stringify(data)).toString('base64');
res.redirect(`${hosts[0]}/#/auth?token=${token}`);
Expand Down
5 changes: 5 additions & 0 deletions src/containers/TheHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ const TheHeader = () => {
<i className="cib-discord"> </i> Discord Logged In
</button>
)}
<div style={{paddingLeft: 10}}>
<button type="button" className="btn btn-dark">
<i className="cib-github"> </i> Github Logged In
</button>
</div>
</div>
</CSubheader>
</CHeader>
Expand Down
9 changes: 7 additions & 2 deletions src/containers/TheHeaderDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import {
CImg
} from '@coreui/react'
import CIcon from '@coreui/icons-react'

function getAvatar() {
const bundlyToken = localStorage.getItem("bundly-token");
let avatar_url;
if (bundlyToken) avatar_url = JSON.parse(atob(bundlyToken)).avatar;
return avatar_url;
}
const TheHeaderDropdown = () => {
return (
<CDropdown
Expand All @@ -18,7 +23,7 @@ const TheHeaderDropdown = () => {
<CDropdownToggle className="c-header-nav-link" caret={false}>
<div className="c-avatar">
<CImg
src={'avatars/6.jpg'}
src={getAvatar()??'https://avatars.dicebear.com/api/male/example.svg'}
className="c-avatar-img"
alt="fellowship@mlh.io"
/>
Expand Down