Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Huỳnh Thiên Phước
venjob
Commits
aaab73c8
Commit
aaab73c8
authored
Aug 17, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix my page, filtered password
parent
126a0b48
Pipeline
#918
failed with stages
in 0 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
7 deletions
+17
-7
app/assets/stylesheets/form_login.scss
+4
-0
app/controllers/users_controller.rb
+2
-1
app/models/user.rb
+1
-3
app/views/users/my_page.html.erb
+7
-1
config/application.rb
+1
-1
config/initializers/filter_parameter_logging.rb
+2
-1
No files found.
app/assets/stylesheets/form_login.scss
View file @
aaab73c8
...
...
@@ -20,4 +20,8 @@
#error_explanation
ul
li
{
color
:
red
;
}
.cv-none
{
font-style
:
italic
;
font-size
:
16px
;
}
app/controllers/users_controller.rb
View file @
aaab73c8
...
...
@@ -7,6 +7,7 @@ class UsersController < ApplicationController
end
def
update
user_params
[
:password
]
=
current_user
.
password_digest
if
user_params
[
:password
].
nil?
if
BCrypt
::
Password
.
new
(
current_user
.
password_digest
)
!=
condition_update
[
:oldpassword
]
flash
.
now
[
:danger
]
=
'Old Password is mismatch'
else
...
...
@@ -31,7 +32,7 @@ class UsersController < ApplicationController
end
def
user_params
params
.
require
(
:user
).
permit
(
:name
,
:email
,
:cv_user
)
params
.
require
(
:user
).
permit
(
:name
,
:email
,
:cv_user
,
:password
)
end
def
condition_update
...
...
app/models/user.rb
View file @
aaab73c8
...
...
@@ -3,7 +3,6 @@ class User < ApplicationRecord
before_create
:create_remember_token
mount_uploader
:cv_user
,
UserCvUploader
has_many
:favorite_jobs
has_many
:jobs
,
through: :favorite_jobs
has_many
:job_applieds
...
...
@@ -18,8 +17,7 @@ class User < ApplicationRecord
validates
:email
,
presence:
true
,
format:
{
with:
VALID_EMAIL_REGEX
},
uniqueness:
{
case_sensitive:
false
}
validates
:password
,
length:
{
minimum:
6
,
too_short:
"is blank or too short"
}
validates
:password
,
allow_nil:
true
,
length:
{
minimum:
6
,
too_short:
"is blank or too short"
}
def
User
.
new_remember_token
SecureRandom
.
urlsafe_base64
...
...
app/views/users/my_page.html.erb
View file @
aaab73c8
...
...
@@ -25,7 +25,13 @@
<%=
f
.
label
:cv_user
,
'My CV'
%>
</div>
<div
class=
"col-8-sm"
>
<%=
link_to
current_user
.
cv_user
.
identifier
,
current_user
.
cv_user
.
url
,
download:
current_user
.
cv_user
.
identifier
%>
<%
if
current_user
.
cv_user
.
present?
%>
<%=
link_to
current_user
.
cv_user
.
identifier
,
current_user
.
cv_user
.
url
,
download:
current_user
.
cv_user
.
identifier
%>
<%
else
%>
<div
class=
"cv-none"
>
Your CV doesn't have at present!
</div>
<%
end
%>
</div>
</div>
...
...
config/application.rb
View file @
aaab73c8
...
...
@@ -10,7 +10,7 @@ module Venjob
class
Application
<
Rails
::
Application
# Initialize configuration defaults for originally generated Rails version.
config
.
load_defaults
5.2
# config.filter_parameter_logging << :oldpassword, :password
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
...
...
config/initializers/filter_parameter_logging.rb
View file @
aaab73c8
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails
.
application
.
config
.
filter_parameters
+=
[
:password
]
Rails
.
application
.
config
.
filter_parameters
+=
[
:password
,
:oldpassword
]
Write
Preview
Markdown
is supported
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