Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
birger
users
Commits
42fcfd3a
Commit
42fcfd3a
authored
Aug 19, 2018
by
o@immerda.ch
Browse files
show app pw as qr code
parent
0e15eed0
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/assets/stylesheets/application.css
View file @
42fcfd3a
...
...
@@ -74,7 +74,7 @@
font-family
:
monospace
;
}
.
recovery-token-qr
{
.
qr-field
{
border
:
dashed
gray
3px
;
padding
:
10px
;
margin-top
:
20px
;
...
...
@@ -83,7 +83,7 @@
width
:
260px
;
}
.
recovery-token-qr
table
{
.
qr-field
table
{
margin
:
0
auto
;
border-width
:
0
;
border-style
:
none
;
...
...
@@ -91,7 +91,7 @@
border-collapse
:
collapse
;
}
.
recovery-token-qr
td
{
.
qr-field
td
{
border-left
:
solid
4px
#000
;
padding
:
0
;
margin
:
0
;
...
...
@@ -99,8 +99,8 @@
height
:
4px
;
}
.
recovery-token-qr
td
.black
{
border-color
:
#000
;
}
.
recovery-token-qr
td
.white
{
border-color
:
#fff
;
}
.
qr-field
td
.black
{
border-color
:
#000
;
}
.
qr-field
td
.white
{
border-color
:
#fff
;
}
.userlist
th
{
font-weight
:
bold
}
.userlist
tr
:nth-child
(
even
)
{
background
:
#ddd
}
...
...
app/controllers/app_passwords_controller.rb
View file @
42fcfd3a
...
...
@@ -5,6 +5,12 @@ class AppPasswordsController < ApplicationController
@passwords
=
res
[
'names'
]
if
session
[
:app_pw
]
@app_pw
=
session
[
:app_pw
]
begin
@qr
=
RQRCode
::
QRCode
.
new
(
@app_pw
,
:size
=>
10
,
:level
=>
:h
)
rescue
=>
e
@qr
=
''
puts
"qr token generation failed
#{
e
}
"
end
session
[
:app_pw
]
=
nil
end
rescue
ApiBackend
::
ApiError
...
...
app/views/app_passwords/show.html.erb
View file @
42fcfd3a
...
...
@@ -4,6 +4,8 @@
<b>
<%=
t
(
:your_app_pw_is
)
%>
</b>
<p>
<div
class=
"app-password"
>
<%=
@app_pw
%>
</div>
<b>
<%=
t
(
:qr_code
)
%>
</b>
<div
class=
"qr-field"
>
<%=
raw
(
@qr
.
as_html
)
%>
</div>
</p>
<%
end
%>
<p>
...
...
app/views/mail_crypt/show.html.erb
View file @
42fcfd3a
...
...
@@ -12,7 +12,7 @@
<p>
<b>
<%=
t
(
:qr_code
)
%>
</b>
<%=
t
(
:qr_token_help
)
%>
<div
class=
"
recovery-token-qr
"
>
<%=
raw
(
@qr
.
as_html
)
%>
</div>
<div
class=
"
qr-field
"
>
<%=
raw
(
@qr
.
as_html
)
%>
</div>
</p>
<%
else
%>
...
...
app/views/signup/success.html.erb
View file @
42fcfd3a
...
...
@@ -19,7 +19,7 @@
<p>
<b>
<%=
t
(
:qr_code
)
%>
</b>
<%=
t
(
:qr_token_help
)
%>
<div
class=
"
recovery-token-qr
"
>
<%=
raw
(
@qr
.
as_html
)
%>
</div>
<div
class=
"
qr-field
"
>
<%=
raw
(
@qr
.
as_html
)
%>
</div>
</p>
<br
/>
<%
else
%>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment