I have a problem implementing the mount_devise_token_auth_for with api versions.
Let's say:
scope module: :v1, constraints: ApiConstraints.new(version: 1) do
mount_devise_token_auth_for 'User', at: '/auth', skip: [ ], controllers: {
registrations: 'v1/users/registrations',
sessions: 'v1/users/sessions'
}
end
If I want to add v2 and mount the authentication at the same path like this:
scope module: :v2, constraints: ApiConstraints.new(version: 2, default: true) do
mount_devise_token_auth_for 'User', at: '/auth', skip: [ ], controllers: {
registrations: 'v2/users/registrations',
sessions: 'v2/users/sessions'
}
end
It fails because the named routes helper for devise already exists with those names.
I could use namespace to deal with that, but we don't want the versions in the URI.
Please advise.
Thanks.