Skip to content

Commit 63efee3

Browse files
committed
Fix login using QR code
1 parent 47908f0 commit 63efee3

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

src/gui/src/UI/UIWindowLoginInProgress.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,26 @@ async function UIWindowLoginInProgress(options){
2323
return new Promise(async (resolve) => {
2424
options = options ?? {};
2525

26-
let h = '';
26+
// get the profile picture of the user
27+
let profile_pic
28+
29+
if(options.user_info?.username){
30+
profile_pic = await get_profile_picture(options.user_info?.username);
31+
}
32+
33+
if(!profile_pic){
34+
profile_pic = window.icons['profile.svg']
35+
}
36+
37+
let h = '';
2738
h += `<div class="login-progress">`;
39+
h += `<div class="profile-pic" style="background-color: #cecece; background-image: url('${profile_pic}'); width: 70px; height: 70px; background-position: center; background-size: cover; border-radius: 50px; margin-bottom: 15px; margin-top: 40px;"></div>`;
2840
h += `<h1 style="text-align: center;
29-
font-size: 20px;
41+
font-size: 17px;
3042
padding: 10px;
31-
font-weight: 300; margin: -10px 10px 20px 10px;">Logging in as <strong>${options.user_info.email === null ? options.user_info.username : options.user_info.email}</strong></h1>`;
43+
font-weight: 300; margin: -10px 10px 4px 10px;">Logging in as <strong>${options.user_info.email === null ? options.user_info.username : options.user_info.email}</strong></h1>`;
3244
// spinner
33-
h +=`<svg style="float:left; margin-right: 7px;" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><title>circle anim</title><g fill="#212121" class="nc-icon-wrapper"><g class="nc-loop-circle-24-icon-f"><path d="M12 24a12 12 0 1 1 12-12 12.013 12.013 0 0 1-12 12zm0-22a10 10 0 1 0 10 10A10.011 10.011 0 0 0 12 2z" fill="#212121" opacity=".4"></path><path d="M24 12h-2A10.011 10.011 0 0 0 12 2V0a12.013 12.013 0 0 1 12 12z" data-color="color-2"></path></g><style>.nc-loop-circle-24-icon-f{--animation-duration:0.5s;transform-origin:12px 12px;animation:nc-loop-circle-anim var(--animation-duration) infinite linear}@keyframes nc-loop-circle-anim{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}</style></g></svg>`;
45+
h +=`<svg style="float:left; margin-right: 7px; margin-bottom: 30px;" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><title>circle anim</title><g fill="#212121" class="nc-icon-wrapper"><g class="nc-loop-circle-24-icon-f"><path d="M12 24a12 12 0 1 1 12-12 12.013 12.013 0 0 1-12 12zm0-22a10 10 0 1 0 10 10A10.011 10.011 0 0 0 12 2z" fill="#212121" opacity=".4"></path><path d="M24 12h-2A10.011 10.011 0 0 0 12 2V0a12.013 12.013 0 0 1 12 12z" data-color="color-2"></path></g><style>.nc-loop-circle-24-icon-f{--animation-duration:0.5s;transform-origin:12px 12px;animation:nc-loop-circle-anim var(--animation-duration) infinite linear}@keyframes nc-loop-circle-anim{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}</style></g></svg>`;
3446

3547
h += `</div>`;
3648

src/gui/src/css/style.css

+1-2
Original file line numberDiff line numberDiff line change
@@ -3187,7 +3187,6 @@ fieldset[name=number-code] {
31873187
}
31883188

31893189
.login-progress {
3190-
height: 200px;
31913190
display: flex;
31923191
flex-direction: column;
31933192
justify-content: center;
@@ -4455,7 +4454,7 @@ fieldset[name=number-code] {
44554454

44564455
}
44574456

4458-
.device-phone .window.window-qr, .device-phone .window.window-progress{
4457+
.device-phone .window.window-qr, .device-phone .window.window-progress, .device-phone .window.window-login-progress{
44594458
left: 50% !important;
44604459
transform: translate(-50%) !important;
44614460
height: initial !important;

src/gui/src/initgui.js

+2
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ window.initgui = async function(options){
393393
else if(window.url_query_params.has('auth_token')){
394394
let query_param_auth_token = window.url_query_params.get('auth_token');
395395

396+
puter.setAuthToken(query_param_auth_token);
397+
396398
try{
397399
whoami = await puter.os.user();
398400
}catch(e){

0 commit comments

Comments
 (0)